Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Logic programming</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Logic_programming"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Logic_programming rootpage-Logic_programming skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Logic programming</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p><b>Logic programming</b> is a <a href="Programming_paradigm" title="Programming paradigm">programming</a>, <a href="Database" title="Database">database</a> and <a href="Knowledge_representation" class="mw-redirect" title="Knowledge representation">knowledge representation</a> paradigm based on formal <a href="Logic" title="Logic">logic</a>. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include <a href="Prolog" title="Prolog">Prolog</a>, <a href="Answer_set_programming" title="Answer set programming">Answer Set Programming</a> (ASP) and <a href="Datalog" title="Datalog">Datalog</a>. In all of these languages, rules are written in the form of <i><a href="Clause_(logic)" title="Clause (logic)">clauses</a></i>:
</p>
<dl><dd><code>A&nbsp;:- B<sub>1</sub>, ..., B<sub>n</sub>.</code></dd></dl>
<p>and are read as declarative sentences in logical form:
</p>
<dl><dd><code>A if B<sub>1</sub> and ... and B<sub>n</sub>.</code></dd></dl>
<p><code>A</code> is called the <i>head</i> of the rule, <code>B<sub>1</sub></code>, ..., <code>B<sub>n</sub></code> is called the <i>body</i>, and the <code>B<sub>i</sub></code> are called <i><a href="Literal_(mathematical_logic)" title="Literal (mathematical logic)">literals</a></i> or conditions. When n = 0, the rule is called a <i>fact</i> and is written in the simplified form:
</p>
<dl><dd><code>A.</code></dd></dl>
<p>Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
</p>
<dl><dd><code>?- B<sub>1</sub>, ..., B<sub>n</sub>.</code></dd></dl>
<p>In the simplest case of <a href="Horn_clause" title="Horn clause">Horn clauses</a> (or "definite" clauses), all of the A, B<sub>1</sub>, ..., B<sub>n</sub> are <a href="Atomic_formula" title="Atomic formula">atomic formulae</a> of the form p(t<sub>1</sub> ,..., t<sub>m</sub>), where p is a predicate symbol naming a relation, like "motherhood", and the t<sub>i</sub> are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter.
</p><p>Consider, for example, the following Horn clause program:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">mother_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">charles</span><span class="p">).</span>
<span class="nf">father_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">father_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">mother_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">father_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nf">grandparent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Z</span><span class="p">),</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">Z</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
</pre></div>
<p>Given a query, the program produces answers.
For instance for a query <code>?- parent_child(X, william)</code>, the single answer is
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">charles</span>
</pre></div>
<p>Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">grandparent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">elizabeth</span>

<span class="s s-Atom">?-</span> <span class="nf">grandparent_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nv">Y</span> <span class="o">=</span> <span class="s s-Atom">william</span><span class="p">;</span>
<span class="nv">Y</span> <span class="o">=</span> <span class="s s-Atom">harry</span><span class="p">.</span>

<span class="s s-Atom">?-</span> <span class="nf">grandparent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">elizabeth</span>
<span class="nv">Y</span> <span class="o">=</span> <span class="s s-Atom">william</span><span class="p">;</span>
<span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">elizabeth</span>
<span class="nv">Y</span> <span class="o">=</span> <span class="s s-Atom">harry</span><span class="p">.</span>

<span class="s s-Atom">?-</span> <span class="nf">grandparent_child</span><span class="p">(</span><span class="s s-Atom">william</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
<span class="s s-Atom">no</span>
<span class="s s-Atom">?-</span> <span class="nf">grandparent_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
<span class="s s-Atom">yes</span>
</pre></div>
<p>Although Horn clause logic programs are <a href="Turing_completeness" title="Turing completeness">Turing complete</a>,<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the <a href="Predicate_(mathematical_logic)" class="mw-redirect" title="Predicate (mathematical logic)">predicate</a> = is defined by the clause <code> X = X </code>:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">sibling</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">Z</span><span class="p">,</span> <span class="nv">X</span><span class="p">),</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">Z</span><span class="p">,</span> <span class="nv">Y</span><span class="p">),</span>
<span class="o">not</span><span class="p">(</span><span class="nv">X</span> <span class="o">=</span> <span class="nv">Y</span><span class="p">).</span>
</pre></div>
<p>Logic programming languages that include negative conditions have the knowledge representation capabilities of a <a href="Non-monotonic_logic" title="Non-monotonic logic">non-monotonic logic</a>.
</p><p>In ASP and Datalog, logic programs have only a <a href="Declarative_programming" title="Declarative programming">declarative</a> reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a <a href="Procedural_programming" title="Procedural programming">procedural</a> interpretation as goal-reduction procedures. From this point of view, clause A&nbsp;:- B<sub>1</sub>,...,B<sub>n</sub> is understood as:
</p>
<dl><dd>to solve <code>A</code>, solve <code>B<sub>1</sub></code>, and ... and solve <code>B<sub>n</sub></code>.</dd></dl>
<p>Negative conditions in the bodies of clauses also have a procedural interpretation, known as <i><a href="Negation_as_failure" title="Negation as failure">negation as failure</a></i>: A negative literal <code> not B</code> is deemed to hold if and only if the positive literal <code> B</code> fails to hold.
</p><p>Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of <a href="Formal_methods" title="Formal methods">formal methods</a> for logic-based <a href="Formal_verification" title="Formal verification">program verification</a> and <a href="Program_transformation" title="Program transformation">program transformation</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>The use of mathematical logic to represent and execute <a href="Computer_program" title="Computer program">computer programs</a> is also a feature of the <a href="Lambda_calculus" title="Lambda calculus">lambda calculus</a>, developed by <a href="Alonzo_Church" title="Alonzo Church">Alonzo Church</a> in the 1930s. However, the first proposal to use the <a href="Clausal_normal_form" class="mw-redirect" title="Clausal normal form">clausal</a> form of logic for representing computer programs was made by <a href="Cordell_Green" title="Cordell Green">Cordell Green</a>.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> This used an axiomatization of a subset of <a href="LISP" class="mw-redirect" title="LISP">LISP</a>, together with a representation of an input-output relation, to compute the relation by simulating the execution of the program in LISP. Foster and Elcock's <a href="Absys" title="Absys">Absys</a>, on the other hand, employed a combination of equations and lambda calculus in an assertional programming language that places no constraints on the order in which operations are performed.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p><p>Logic programming, with its current syntax of facts and rules, can be traced back to debates in the late 1960s and early 1970s about declarative versus procedural representations of knowledge in <a href="Artificial_intelligence" title="Artificial intelligence">artificial intelligence</a>. Advocates of declarative representations were notably working at <a href="Stanford_University" title="Stanford University">Stanford</a>, associated with <a href="John_McCarthy_(computer_scientist)" title="John McCarthy (computer scientist)">John McCarthy</a>, <a href="Bertram_Raphael" title="Bertram Raphael">Bertram Raphael</a> and Cordell Green, and in <a href="University_of_Edinburgh" title="University of Edinburgh">Edinburgh</a>, with <a href="John_Alan_Robinson" title="John Alan Robinson">John Alan Robinson</a> (an academic visitor from <a href="Syracuse_University" title="Syracuse University">Syracuse University</a>), <a href="Patrick_J._Hayes" class="mw-redirect" title="Patrick J. Hayes">Pat Hayes</a>, and <a href="Robert_Kowalski" title="Robert Kowalski">Robert Kowalski</a>. Advocates of procedural representations were mainly centered at <a href="MIT" class="mw-redirect" title="MIT">MIT</a>, under the leadership of <a href="Marvin_Minsky" title="Marvin Minsky">Marvin Minsky</a> and <a href="Seymour_Papert" title="Seymour Papert">Seymour Papert</a>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p><p>Although it was based on the proof methods of logic, <a href="Planner_(programming_language)" title="Planner (programming language)">Planner</a>, developed by <a href="Carl_Hewitt" title="Carl Hewitt">Carl Hewitt</a> at MIT, was the first language to emerge within this proceduralist paradigm.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> Planner featured pattern-directed invocation of procedural plans from goals (i.e. goal-reduction or <a href="Backward_chaining" title="Backward chaining">backward chaining</a>) and from assertions (i.e. <a href="Forward_chaining" title="Forward chaining">forward chaining</a>). The most influential implementation of Planner was the subset of Planner, called Micro-Planner, implemented by <a href="Gerald_Jay_Sussman" title="Gerald Jay Sussman">Gerry Sussman</a>, <a href="Eugene_Charniak" title="Eugene Charniak">Eugene Charniak</a> and <a href="Terry_Winograd" title="Terry Winograd">Terry Winograd</a>. Winograd used Micro-Planner to implement the landmark, natural-language understanding program <a href="SHRDLU" title="SHRDLU">SHRDLU</a>.<sup id="cite_ref-Winograd_7-0" class="reference"><a href="#cite_note-Winograd-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> For the sake of efficiency, Planner used a backtracking control structure so that only one possible computation path had to be stored at a time. Planner gave rise to the programming languages <a href="Richard_Waldinger#QA4" title="Richard Waldinger">QA4</a>,<sup id="cite_ref-Rulifson_8-0" class="reference"><a href="#cite_note-Rulifson-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> Popler,<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup> Conniver,<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> QLISP,<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> and the concurrent language Ether.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup>
</p><p>Hayes and Kowalski in Edinburgh tried to reconcile the logic-based declarative approach to knowledge representation with Planner's procedural approach. Hayes (1973) developed an equational language, Golux, in which different procedures could be obtained by altering the behavior of the theorem prover.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p><p>In the meanwhile, <a href="Alain_Colmerauer" title="Alain Colmerauer">Alain Colmerauer</a> in <a href="Marseille" title="Marseille">Marseille</a> was working on <a href="Natural-language_understanding" class="mw-redirect" title="Natural-language understanding">natural-language understanding</a>, using logic to represent semantics and using resolution for question-answering. During the summer of 1971, Colmerauer invited Kowalski to Marseille, and together they discovered that the clausal form of logic could be used to represent <a href="Formal_grammars" class="mw-redirect" title="Formal grammars">formal grammars</a> and that resolution theorem provers could be used for parsing. They observed that some theorem provers, like hyper-resolution,<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> behave as bottom-up parsers and others, like <a href="SLD_resolution" title="SLD resolution">SL resolution</a> (1971)<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> behave as top-down parsers.
</p><p>It was in the following summer of 1972, that Kowalski, again working with Colmerauer, developed the procedural interpretation of implications in clausal form. It also became clear that such clauses could be restricted to definite clauses or <a href="Horn_clause" title="Horn clause">Horn clauses</a>, and that SL-resolution could be restricted (and generalised) to <a href="SLD_resolution" title="SLD resolution">SLD resolution</a>. Kowalski's procedural interpretation and SLD were described in a 1973 memo, published in 1974.<sup id="cite_ref-Kowalski_16-0" class="reference"><a href="#cite_note-Kowalski-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup>
</p><p>Colmerauer, with Philippe Roussel, used the procedural interpretation as the basis of Prolog, which was implemented in the summer and autumn of 1972. The first Prolog program, also written in 1972 and implemented in Marseille, was a French question-answering system. The use of Prolog as a practical programming language was given great momentum by the development of a compiler by <a href="David_H._D._Warren" title="David H. D. Warren">David H. D. Warren</a> in Edinburgh in 1977. Experiments demonstrated that Edinburgh Prolog could compete with the processing speed of other <a href="Symbolic_programming" title="Symbolic programming">symbolic programming</a> languages such as <a href="Lisp_(programming_language)" title="Lisp (programming language)">Lisp</a>.<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup> Edinburgh Prolog became the <i>de facto</i> standard and strongly influenced the definition of <a href="International_Organization_for_Standardization" title="International Organization for Standardization">ISO</a> standard Prolog.
</p><p>Logic programming gained international attention during the 1980s, when it was chosen by the Japanese <a href="Ministry_of_International_Trade_and_Industry" title="Ministry of International Trade and Industry">Ministry of International Trade and Industry</a> to develop the software for the <a href="Fifth_Generation_Computer_Systems" title="Fifth Generation Computer Systems">Fifth Generation Computer Systems</a> (FGCS) project. The FGCS project aimed to use logic programming to develop advanced <a href="Artificial_Intelligence" class="mw-redirect" title="Artificial Intelligence">Artificial Intelligence</a> applications on massively <a href="Parallel_computing" title="Parallel computing">parallel computers</a>. Although the project initially explored the use of Prolog, it later adopted the use of <a href="Concurrent_logic_programming" title="Concurrent logic programming">concurrent logic programming</a>, because it was closer to the FGCS computer architecture.
</p><p>However, the committed choice feature of concurrent logic programming interfered with the language's logical semantics<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup> and with its suitability for knowledge representation and problem solving applications. Moreover, the parallel computer systems developed in the project failed to compete with advances taking place in the development of more conventional, general-purpose computers. Together these two issues resulted in the FGCS project failing to meet its objectives. Interest in both logic programming and AI fell into world-wide decline.<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup>
</p><p>In the meanwhile, more declarative logic programming approaches, including those based on the use of Prolog, continued to make progress independently of the FGCS project. In particular, although Prolog was developed to combine declarative and procedural representations of knowledge, the purely declarative interpretation of logic programs became the focus for applications in the field of <a href="Deductive_database" title="Deductive database">deductive databases</a>. Work in this field became prominent around 1977, when Hervé Gallaire and <a href="Jack_Minker" title="Jack Minker">Jack Minker</a> organized a workshop on logic and databases in Toulouse.<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup> The field was eventually renamed as <i><a href="Datalog" title="Datalog">Datalog</a></i>.
</p><p>This focus on the logical, declarative reading of logic programs was given further impetus by the development of <a href="Constraint_logic_programming" title="Constraint logic programming">constraint logic programming</a> in the 1980s and <a href="Answer_set_programming" title="Answer set programming">Answer Set Programming</a> in the 1990s. It is also receiving renewed emphasis in recent applications of Prolog<sup id="cite_ref-Prolog_Book_21-0" class="reference"><a href="#cite_note-Prolog_Book-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup>
</p><p>The <a href="Association_for_Logic_Programming" title="Association for Logic Programming">Association for Logic Programming</a> (ALP) was founded in 1986 to promote Logic Programming. Its official journal until 2000, was <i><a href="The_Journal_of_Logic_Programming" class="mw-redirect" title="The Journal of Logic Programming">The Journal of Logic Programming</a></i>. Its founding <a href="Editor-in-chief" title="Editor-in-chief">editor-in-chief</a> was <a href="J._Alan_Robinson" class="mw-redirect" title="J. Alan Robinson">J. Alan Robinson</a>.<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup> In 2001, the journal was renamed <i>The Journal of Logic and Algebraic Programming</i>, and the official journal of ALP became <i><a href="Theory_and_Practice_of_Logic_Programming" class="mw-redirect" title="Theory and Practice of Logic Programming">Theory and Practice of Logic Programming</a></i>, published by <a href="Cambridge_University_Press" title="Cambridge University Press">Cambridge University Press</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Concepts">Concepts</h2></div>
<p>Logic programs enjoy a rich variety of semantics and problem solving methods, as well as a wide range of applications in programming, databases, knowledge representation and problem solving.
</p>
<div class="mw-heading mw-heading3"><h3 id="Algorithm_=_Logic_+_Control">Algorithm = Logic + Control</h3></div>
<p>The procedural interpretation of logic programs, which uses backward reasoning to reduce goals to subgoals, is a special case of the use of a problem-solving strategy to <b>control</b> the use of a declarative, <b>logical</b> representation of knowledge to obtain the behaviour of an <b>algorithm</b>. More generally, different problem-solving strategies can be applied to the same logical representation to obtain different algorithms. Alternatively, different algorithms can be obtained with a given problem-solving strategy by using different logical representations.<sup id="cite_ref-23" class="reference"><a href="#cite_note-23"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup>
</p><p>The two main problem-solving strategies are <a href="Backward_chaining" title="Backward chaining">backward reasoning</a> (goal reduction) and <a href="Forward_chaining" title="Forward chaining">forward reasoning</a>, also known as top-down and bottom-up reasoning, respectively.
</p><p>In the simple case of a propositional Horn clause program and a top-level atomic goal, backward reasoning determines an <a href="And-or_tree" class="mw-redirect" title="And-or tree">and-or tree</a>, which constitutes the search space for solving the goal. The top-level goal is the root of the tree. Given any node in the tree and any clause whose head matches the node, there exists a set of child nodes corresponding to the sub-goals in the body of the clause. These child nodes are grouped together by an "and". The alternative sets of children corresponding to alternative ways of solving the node are grouped together by an "or".
</p><p>Any search strategy can be used to search this space. Prolog uses a sequential, last-in-first-out, backtracking strategy, in which only one alternative and one sub-goal are considered at a time. For example, subgoals can be solved in parallel, and clauses can also be tried in parallel. The first strategy is called <b><style data-mw-deduplicate="TemplateStyles:r1238216509">
/* start https://en.wikipedia.org/ */


.mw-parser-output .vanchor>:target~.vanchor-text{background-color:#b1d2ff}@media screen{html.skin-theme-clientpref-night .mw-parser-output .vanchor>:target~.vanchor-text{background-color:#0f4dc9}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .vanchor>:target~.vanchor-text{background-color:#0f4dc9}}


/* end https://en.wikipedia.org/ */
</style><span class="vanchor"><span class="vanchor-text">and-parallel</span></span></b> and the second strategy is called <b><span class="vanchor"><span class="vanchor-text">or-parallel</span></span></b>. Other search strategies, such as intelligent backtracking,<sup id="cite_ref-24" class="reference"><a href="#cite_note-24"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup> or best-first search to find an optimal solution,<sup id="cite_ref-25" class="reference"><a href="#cite_note-25"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup> are also possible.
</p><p>In the more general, non-propositional case, where sub-goals can share variables, other strategies can be used, such as choosing the subgoal that is most highly instantiated or that is sufficiently instantiated so that only one procedure applies.<sup id="cite_ref-26" class="reference"><a href="#cite_note-26"><span class="cite-bracket">[</span>26<span class="cite-bracket">]</span></a></sup> Such strategies are used, for example, in <a href="Concurrent_logic_programming" title="Concurrent logic programming">concurrent logic programming</a>.
</p><p>In most cases, backward reasoning from a query or goal is more efficient than forward reasoning. But sometimes with Datalog and Answer Set Programming, there may be no query that is separate from the set of clauses as a whole, and then generating all the facts that can be derived from the clauses is a sensible problem-solving strategy. Here is another example, where forward reasoning beats backward reasoning in a more conventional computation task, where the goal <code>?- fibonacci(n, Result)</code> is to find the n<sup>th</sup> fibonacci number:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">fibonacci</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">fibonacci</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span>

<span class="nf">fibonacci</span><span class="p">(</span><span class="nv">N</span><span class="p">,</span> <span class="nv">Result</span><span class="p">)</span> <span class="p">:-</span>
<span class="nv">N</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">,</span>
<span class="nv">N1</span> <span class="o">is</span> <span class="nv">N</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span>
<span class="nv">N2</span> <span class="o">is</span> <span class="nv">N</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span>
<span class="nf">fibonacci</span><span class="p">(</span><span class="nv">N1</span><span class="p">,</span> <span class="nv">F1</span><span class="p">),</span>
<span class="nf">fibonacci</span><span class="p">(</span><span class="nv">N2</span><span class="p">,</span> <span class="nv">F2</span><span class="p">),</span>
<span class="nv">Result</span> <span class="o">is</span> <span class="nv">F1</span> <span class="o">+</span> <span class="nv">F2</span><span class="p">.</span>
</pre></div>
<p>Here the relation <code>fibonacci(N, M)</code> stands for the function <code>fibonacci(N) = M</code>, and the predicate <code>N is Expression</code> is Prolog notation for the predicate that instantiates the variable <code>N</code> to the value of <code>Expression</code>.
</p><p>Given the goal of computing the fibonacci number of <code>n</code>, backward reasoning reduces the goal to the two subgoals of computing the fibonacci numbers of n-1 and n-2. It reduces the subgoal of computing the fibonacci number of n-1 to the two subgoals of computing the fibonacci numbers of n-2 and n-3, redundantly computing the fibonacci number of n-2. This process of reducing one fibonacci subgoal to two fibonacci subgoals continues until it reaches the numbers 0 and 1. Its complexity is of the order 2<sup>n</sup>. In contrast, forward reasoning generates the sequence of fibonacci numbers, starting from 0 and 1 without any recomputation, and its complexity is linear with respect to n.
</p><p>Prolog cannot perform forward reasoning directly. But it can achieve the effect of forward reasoning within the context of backward reasoning by means of <a href="Tabling" class="mw-redirect" title="Tabling">tabling</a>: Subgoals are maintained in a table, along with their solutions. If a subgoal is re-encountered, it is solved directly by using the solutions already in the table, instead of re-solving the subgoals redundantly.<sup id="cite_ref-27" class="reference"><a href="#cite_note-27"><span class="cite-bracket">[</span>27<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Relationship_with_functional_programming">Relationship with functional programming</h3></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">See also: <a href="Functional_programming#Comparison_to_logic_programming" title="Functional programming">Functional programming §&nbsp;Comparison to logic programming</a></div>
<p>Logic programming can be viewed as a generalisation of functional programming, in which functions are a special case of relations.<sup id="cite_ref-dis_28-0" class="reference"><a href="#cite_note-dis-28"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup>
For example, the function, mother(X) = Y, (every X has only one mother Y) can be represented by the relation mother(X, Y). In this respect, logic programs are similar to <a href="Relational_databases" class="mw-redirect" title="Relational databases">relational databases</a>, which also represent functions as relations.
</p><p>Compared with relational syntax, functional syntax is more compact for nested functions. For example, in functional syntax the definition of maternal grandmother can be written in the nested form:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">maternal_grandmother</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="o">=</span> <span class="nf">mother</span><span class="p">(</span><span class="nf">mother</span><span class="p">(</span><span class="nv">X</span><span class="p">)).</span>
</pre></div>
<p>The same definition in relational notation needs to be written in the unnested, flattened form:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">maternal_grandmother</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">mother</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Z</span><span class="p">),</span> <span class="nf">mother</span><span class="p">(</span><span class="nv">Z</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
</pre></div>
<p>However, nested syntax can be regarded as syntactic sugar for unnested syntax. <a href="Ciao_(programming_language)" title="Ciao (programming language)">Ciao</a> Prolog, for example, transforms functional syntax into relational form and executes the resulting logic program using the standard Prolog execution strategy.<sup id="cite_ref-29" class="reference"><a href="#cite_note-29"><span class="cite-bracket">[</span>29<span class="cite-bracket">]</span></a></sup> Moreover, the same transformation can be used to execute nested relations that are not functional. For example:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">grandparent</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="nf">parent</span><span class="p">(</span><span class="nf">parent</span><span class="p">(</span><span class="nv">X</span><span class="p">)).</span>
<span class="nf">parent</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="nf">mother</span><span class="p">(</span><span class="nv">X</span><span class="p">).</span>
<span class="nf">parent</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="nf">father</span><span class="p">(</span><span class="nv">X</span><span class="p">).</span>

<span class="nf">mother</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="s s-Atom">elizabeth</span><span class="p">.</span>
<span class="nf">father</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="s s-Atom">phillip</span><span class="p">.</span>
<span class="nf">mother</span><span class="p">(</span><span class="s s-Atom">harry</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="s s-Atom">diana</span><span class="p">.</span>
<span class="nf">father</span><span class="p">(</span><span class="s s-Atom">harry</span><span class="p">)</span> <span class="s s-Atom">:=</span> <span class="s s-Atom">charles</span><span class="p">.</span>

<span class="s s-Atom">?-</span> <span class="nf">grandparent</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span><span class="nv">Y</span><span class="p">).</span>
<span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">harry</span><span class="p">,</span>
<span class="nv">Y</span> <span class="o">=</span> <span class="s s-Atom">elizabeth</span><span class="p">.</span>
<span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">harry</span><span class="p">,</span>
<span class="nv">Y</span> <span class="o">=</span> <span class="s s-Atom">phillip</span><span class="p">.</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Relationship_with_relational_programming">Relationship with relational programming</h3></div>
<p>The term <i>relational programming</i> has been used to cover a variety of programming languages that treat functions as a special case of relations. Some of these languages, such as <a href="MiniKanren" title="MiniKanren">miniKanren</a><sup id="cite_ref-dis_28-1" class="reference"><a href="#cite_note-dis-28"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup>
and relational linear programming<sup id="cite_ref-30" class="reference"><a href="#cite_note-30"><span class="cite-bracket">[</span>30<span class="cite-bracket">]</span></a></sup>
are logic programming languages in the sense of this article.
</p><p>However, the relational language RML is an imperative programming language
<sup id="cite_ref-31" class="reference"><a href="#cite_note-31"><span class="cite-bracket">[</span>31<span class="cite-bracket">]</span></a></sup> whose core construct is a
relational expression, which is similar to an expression in first-order predicate logic.
</p><p>Other relational programming languages are based on the relational calculus<sup id="cite_ref-32" class="reference"><a href="#cite_note-32"><span class="cite-bracket">[</span>32<span class="cite-bracket">]</span></a></sup> or relational algebra.<sup id="cite_ref-33" class="reference"><a href="#cite_note-33"><span class="cite-bracket">[</span>33<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Semantics_of_Horn_clause_programs">Semantics of Horn clause programs</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Syntax_and_semantics_of_logic_programming" title="Syntax and semantics of logic programming">Syntax and semantics of logic programming</a></div>
<p>Viewed in purely logical terms, there are two approaches to the declarative semantics of Horn clause logic programs: One approach is the original <i><a href="Logical_consequence" title="Logical consequence">logical consequence</a> semantics</i>, which understands solving a goal as showing that the goal is a theorem that is true in all <a href="Structure_(mathematical_logic)#Structures_and_first-order_logic" title="Structure (mathematical logic)">models</a> of the program.
</p><p>In this approach, computation is <a href="Automated_theorem_proving" title="Automated theorem proving">theorem-proving</a> in <a href="First-order_logic" title="First-order logic">first-order logic</a>; and both <a href="Backward_chaining" title="Backward chaining">backward reasoning</a>, as in SLD resolution, and <a href="Forward_chaining" title="Forward chaining">forward reasoning</a>, as in hyper-resolution, are correct and complete theorem-proving methods. Sometimes such theorem-proving methods are also regarded as providing a separate <a href="Proof-theoretic_semantics" title="Proof-theoretic semantics">proof-theoretic (or operational) semantics</a> for logic programs. But from a logical point of view, they are proof methods, rather than semantics.
</p><p>The other approach to the declarative semantics of Horn clause programs is the <i><a href="Satisfiability" title="Satisfiability">satisfiability</a> semantics</i>, which understands solving a goal as showing that the goal is true (or satisfied) in some <a href="Intended_interpretation" class="mw-redirect" title="Intended interpretation">intended (or standard) model</a> of the program. For Horn clause programs, there always exists such a standard model: It is the unique <i>minimal model</i> of the program.
</p><p>Informally speaking, a minimal model is a model that, when it is viewed as the set of all (variable-free) facts that are true in the model, contains no smaller set of facts that is also a model of the program.
</p><p>For example, the following facts represent the minimal model of the family relationships example in the introduction of this article. All other variable-free facts are false in the model:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">mother_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">charles</span><span class="p">).</span>
<span class="nf">father_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">father_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">charles</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
<span class="nf">grandparent_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">grandparent_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
</pre></div>
<p>The satisfiability semantics also has an alternative, more mathematical characterisation as the <a href="Least_fixed_point" title="Least fixed point">least fixed point</a> of the function that uses the rules in the program to derive new facts from existing facts in one step of inference.
</p><p>Remarkably, the same problem-solving methods of forward and backward reasoning, which were originally developed for the logical consequence semantics, are equally applicable to the satisfiability semantics: Forward reasoning generates the minimal model of a Horn clause program, by deriving new facts from existing facts, until no new additional facts can be generated. Backward reasoning, which succeeds by reducing a goal to subgoals, until all subgoals are solved by facts, ensures that the goal is true in the minimal model, without generating the model explicitly.<sup id="cite_ref-34" class="reference"><a href="#cite_note-34"><span class="cite-bracket">[</span>34<span class="cite-bracket">]</span></a></sup>
</p><p>The difference between the two declarative semantics can be seen with the definitions of addition and multiplication in <a href="Peano_arithmetic" class="mw-redirect" title="Peano arithmetic">successor arithmetic</a>, which represents the natural numbers <code>0, 1, 2, ...</code> as a sequence of terms of the form <code>0, s(0), s(s(0)), ...</code>. In general, the term <code>s(X)</code> represents the successor of <code>X,</code> namely <code>X + 1.</code> Here are the standard definitions of addition and multiplication in functional notation:
</p>
<pre> X + 0 = X.
X + s(Y) = s(X + Y).
i.e. X + (Y + 1) = (X + Y) + 1

X × 0 = 0.
X × s(Y) = X + (X × Y).
i.e. X × (Y + 1) = X + (X × Y).
</pre>
<p>Here are the same definitions as a logic program, using <code>add(X, Y, Z)</code> to represent <code>X + Y = Z,</code> and <code>multiply(X, Y, Z)</code> to represent <code>X × Y = Z</code>:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">add</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">X</span><span class="p">).</span>
<span class="nf">add</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nf">s</span><span class="p">(</span><span class="nv">Y</span><span class="p">),</span> <span class="nf">s</span><span class="p">(</span><span class="nv">Z</span><span class="p">))</span> <span class="p">:-</span> <span class="nf">add</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">,</span> <span class="nv">Z</span><span class="p">).</span>

<span class="nf">multiply</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">multiply</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nf">s</span><span class="p">(</span><span class="nv">Y</span><span class="p">),</span> <span class="nv">W</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">multiply</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">,</span> <span class="nv">Z</span><span class="p">),</span> <span class="nf">add</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Z</span><span class="p">,</span> <span class="nv">W</span><span class="p">).</span>
</pre></div>
<p>The two declarative semantics both give the same answers for the same existentially quantified conjunctions of addition and multiplication goals. For example <code>2 × 2 = X</code> has the solution <code>X = 4</code>; and <code>X × X = X + X</code> has two solutions <code>X = 0</code> and <code>X = 2</code>:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="s s-Atom">?-</span> <span class="nf">multiply</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span> <span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span> <span class="nv">X</span><span class="p">).</span>
<span class="nv">X</span> <span class="o">=</span> <span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)))).</span>

<span class="s s-Atom">?-</span> <span class="nf">multiply</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">),</span> <span class="nf">add</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nv">X</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">Y</span> <span class="o">=</span> <span class="mf">0.</span>
<span class="nv">X</span> <span class="o">=</span> <span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span> <span class="nv">Y</span> <span class="o">=</span> <span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)))).</span>
</pre></div>
<p>However, with the logical-consequence semantics, there are non-standard models of the program, in which, for example, <code>add(s(s(0)), s(s(0)), s(s(s(s(s(0)))))),</code> i.e. <code>2 + 2 = 5</code> is true. But with the satisfiability semantics, there is only one model, namely the standard model of arithmetic, in which <code>2 + 2 = 5</code> is false.
</p><p>In both semantics, the goal <code class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><span class="s s-Atom">?-</span> <span class="nf">add</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span> <span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span> <span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="nf">s</span><span class="p">(</span><span class="mi">0</span><span class="p">))))))</span></code> fails. In the satisfiability semantics, the failure of the goal means that the truth value of the goal is false. But in the logical consequence semantics, the failure means that the truth value of the goal is unknown.
</p>
<div class="mw-heading mw-heading3"><h3 id="Negation_as_failure">Negation as failure</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Negation_as_failure" title="Negation as failure">Negation as failure</a></div>
<p><a href="Negation_as_failure" title="Negation as failure">Negation as failure</a> (NAF), as a way of concluding that a negative condition <code>not p</code> holds by showing that the positive condition <code>p</code> fails to hold, was already a feature of early Prolog systems. The resulting extension of <a href="SLD_resolution" title="SLD resolution">SLD resolution</a> is called <a href="SLD_resolution#SLDNF" title="SLD resolution">SLDNF</a>. A similar construct, called "thnot", also existed in <a href="Micro-Planner_(programming_language)" class="mw-redirect" title="Micro-Planner (programming language)">Micro-Planner</a>.
</p><p>The logical semantics of NAF was unresolved until <a href="Keith_Clark_(computer_scientist)" title="Keith Clark (computer scientist)">Keith Clark</a><sup id="cite_ref-35" class="reference"><a href="#cite_note-35"><span class="cite-bracket">[</span>35<span class="cite-bracket">]</span></a></sup> showed that, under certain natural conditions, NAF is an efficient, correct (and sometimes complete) way of reasoning with the logical consequence semantics using the <a href="Negation_as_failure#Completion_semantics" title="Negation as failure"><i>completion</i></a> of a logic program in first-order logic.
</p><p>Completion amounts roughly to regarding the set of all the program clauses with the same predicate in the head, say:
</p>
<dl><dd><code>A&nbsp;:- Body<sub>1</sub>.</code></dd>
<dd><code> ...</code></dd>
<dd><code>A&nbsp;:- Body<sub>k</sub>.</code></dd></dl>
<p>as a definition of the predicate:
</p>
<dl><dd><code>A iff (Body<sub>1</sub> or ... or Body<sub>k</sub>)</code></dd></dl>
<p>where <code>iff</code> means "if and only if". The completion also includes axioms of equality, which correspond to <a href="Unification_(computer_science)" title="Unification (computer science)">unification</a>. Clark showed that proofs generated by SLDNF are structurally similar to proofs generated by a natural deduction style of reasoning with the completion of the program.
</p><p>Consider, for example, the following program:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="s s-Atom">punishment</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">is_a_thief</span><span class="p">(</span><span class="nv">X</span><span class="p">),</span>
<span class="o">not</span> <span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="s s-Atom">rehabilitation</span><span class="p">).</span>
<span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="s s-Atom">rehabilitation</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">is_a_thief</span><span class="p">(</span><span class="nv">X</span><span class="p">),</span>
<span class="nf">is_a_minor</span><span class="p">(</span><span class="nv">X</span><span class="p">),</span>
<span class="o">not</span> <span class="nf">is_violent</span><span class="p">(</span><span class="nv">X</span><span class="p">).</span>
<span class="nf">is_a_thief</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">).</span>
</pre></div>
<p>Given the goal of determining whether tom should receive a sanction, the first rule succeeds in showing that tom should be punished:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="s s-Atom">?-</span> <span class="nf">should_receive_sanction</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">,</span> <span class="nv">Sanction</span><span class="p">).</span>
<span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">punishment</span><span class="p">.</span>
</pre></div>
<p>This is because tom is a thief, and it cannot be shown that tom should be rehabilitated. It cannot be shown that tom should be rehabilitated, because it cannot be shown that tom is a minor.
</p><p>If, however, we receive new information that tom is indeed a minor, the previous conclusion that tom should be punished is replaced by the new conclusion that tom should be rehabilitated:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">minor</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">).</span>

<span class="s s-Atom">?-</span> <span class="nf">should_receive_sanction</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">,</span> <span class="nv">Sanction</span><span class="p">).</span>
<span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">rehabilitation</span><span class="p">.</span>
</pre></div>
<p>This property of withdrawing a conclusion when new information is added, is called non-monotonicity, and it makes logic programming a <a href="Non-monotonic_logic" title="Non-monotonic logic">non-monotonic logic</a>.
</p><p>But, if we are now told that tom is violent, the conclusion that tom should be punished will be reinstated:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">violent</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">).</span>

<span class="s s-Atom">?-</span> <span class="nf">should_receive_sanction</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">,</span> <span class="nv">Sanction</span><span class="p">).</span>
<span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">punishment</span><span class="p">.</span>
</pre></div>
<p>The completion of this program is:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Sanction</span><span class="p">)</span> <span class="s s-Atom">iff</span>
<span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">punishment</span><span class="p">,</span> <span class="nf">is_a_thief</span><span class="p">(</span><span class="nv">X</span><span class="p">),</span>
<span class="o">not</span> <span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="s s-Atom">rehabilitation</span><span class="p">)</span>
<span class="s s-Atom">or</span> <span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">rehabilitation</span><span class="p">,</span> <span class="nf">is_a_thief</span><span class="p">(</span><span class="nv">X</span><span class="p">),</span> <span class="nf">is_a_minor</span><span class="p">(</span><span class="nv">X</span><span class="p">),</span>
<span class="o">not</span> <span class="nf">is_violent</span><span class="p">(</span><span class="nv">X</span><span class="p">).</span>
<span class="nf">is_a_thief</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="s s-Atom">iff</span> <span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">tom</span><span class="p">.</span>
<span class="nf">is_a_minor</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="s s-Atom">iff</span> <span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">tom</span><span class="p">.</span>
<span class="nf">is_violent</span><span class="p">(</span><span class="nv">X</span><span class="p">)</span> <span class="s s-Atom">iff</span> <span class="nv">X</span> <span class="o">=</span> <span class="s s-Atom">tom</span><span class="p">.</span>
</pre></div>
<p>The notion of completion is closely related to <a href="John_McCarthy_(computer_scientist)" title="John McCarthy (computer scientist)">John McCarthy's</a> <a href="Circumscription_(logic)" title="Circumscription (logic)">circumscription</a> semantics for default reasoning,<sup id="cite_ref-36" class="reference"><a href="#cite_note-36"><span class="cite-bracket">[</span>36<span class="cite-bracket">]</span></a></sup> and to <a href="Raymond_Reiter" title="Raymond Reiter">Ray Reiter's</a> <a href="Closed_world_assumption" class="mw-redirect" title="Closed world assumption">closed world assumption</a>.<sup id="cite_ref-37" class="reference"><a href="#cite_note-37"><span class="cite-bracket">[</span>37<span class="cite-bracket">]</span></a></sup>
</p><p>The completion semantics for negation is a logical consequence semantics, for which SLDNF provides a proof-theoretic implementation. However, in the 1980s, the satisfiability semantics became more popular for logic programs with negation. In the satisfiability semantics, negation is interpreted according to the classical definition of truth in an intended or standard model of the logic program.
</p><p>In the case of logic programs with negative conditions, there are two main variants of the satisfiability semantics: In the <a href="Well-founded_semantics" title="Well-founded semantics">well-founded semantics</a>, the intended model of a logic program is a unique, three-valued, minimal model, which always exists. The well-founded semantics generalises the notion of <a href="Inductive_definition" class="mw-redirect" title="Inductive definition">inductive definition</a> in mathematical logic.<sup id="cite_ref-38" class="reference"><a href="#cite_note-38"><span class="cite-bracket">[</span>38<span class="cite-bracket">]</span></a></sup> <a href="XSB" title="XSB">XSB Prolog</a><sup id="cite_ref-39" class="reference"><a href="#cite_note-39"><span class="cite-bracket">[</span>39<span class="cite-bracket">]</span></a></sup> implements the well-founded semantics using SLG resolution.<sup id="cite_ref-40" class="reference"><a href="#cite_note-40"><span class="cite-bracket">[</span>40<span class="cite-bracket">]</span></a></sup>
</p><p>In the alternative <a href="Stable_model_semantics" title="Stable model semantics">stable model semantics</a>, there may be no intended models or several intended models, all of which are minimal and two-valued. The stable model semantics underpins <a href="Answer_set_programming" title="Answer set programming">answer set programming</a> (ASP).
</p><p>Both the well-founded and stable model semantics apply to arbitrary logic programs with negation. However, both semantics coincide for <a href="Syntax_and_semantics_of_logic_programming#Stratified_negation" title="Syntax and semantics of logic programming">stratified</a> logic programs. For example, the program for sanctioning thieves is (locally) stratified, and all three semantics for the program determine the same intended model:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">should_receive_sanction</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">,</span> <span class="s s-Atom">punishment</span><span class="p">).</span>
<span class="nf">is_a_thief</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">).</span>
<span class="nf">is_a_minor</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">).</span>
<span class="nf">is_violent</span><span class="p">(</span><span class="s s-Atom">tom</span><span class="p">).</span>
</pre></div>
<p>Attempts to understand negation in logic programming have also contributed to the development of <a href="Argumentation_framework" title="Argumentation framework">abstract argumentation frameworks</a>.<sup id="cite_ref-41" class="reference"><a href="#cite_note-41"><span class="cite-bracket">[</span>41<span class="cite-bracket">]</span></a></sup> In an argumentation interpretation of negation, the initial argument that tom should be punished because he is a thief, is attacked by the argument that he should be rehabilitated because he is a minor. But the fact that tom is violent undermines the argument that tom should be rehabilitated and reinstates the argument that tom should be punished.
</p>
<div class="mw-heading mw-heading3"><h3 id="Metalogic_programming">Metalogic programming</h3></div>
<p><a href="Metaprogramming" title="Metaprogramming">Metaprogramming</a>, in which programs are treated as data, was already a feature of early Prolog implementations.<sup id="cite_ref-42" class="reference"><a href="#cite_note-42"><span class="cite-bracket">[</span>42<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Warren_43-0" class="reference"><a href="#cite_note-Warren-43"><span class="cite-bracket">[</span>43<span class="cite-bracket">]</span></a></sup> For example, the Edinburgh DEC10 implementation of Prolog included "an interpreter and a compiler, both written in Prolog itself".<sup id="cite_ref-Warren_43-1" class="reference"><a href="#cite_note-Warren-43"><span class="cite-bracket">[</span>43<span class="cite-bracket">]</span></a></sup> The simplest metaprogram is the so-called "<a href="Vanilla_(computing)" class="mw-redirect" title="Vanilla (computing)">vanilla</a>" meta-interpreter:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre> <span class="nf">solve</span><span class="p">(</span><span class="s s-Atom">true</span><span class="p">).</span>
<span class="nf">solve</span><span class="p">((</span><span class="nv">B</span><span class="p">,</span><span class="nv">C</span><span class="p">)):-</span> <span class="nf">solve</span><span class="p">(</span><span class="nv">B</span><span class="p">),</span><span class="nf">solve</span><span class="p">(</span><span class="nv">C</span><span class="p">).</span>
<span class="nf">solve</span><span class="p">(</span><span class="nv">A</span><span class="p">):-</span> <span class="nf">clause</span><span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">),</span><span class="nf">solve</span><span class="p">(</span><span class="nv">B</span><span class="p">).</span>
</pre></div>
<p>where true represents an empty conjunction, and (B,C) is a composite term representing the conjunction of B and C. The predicate clause(A,B) means that there is a clause of the form A&nbsp;:- B.
</p><p>Metaprogramming is an application of the more general use of a <i><a href="Metalogic" title="Metalogic">metalogic</a></i> or <i><a href="Metalanguage" title="Metalanguage">metalanguage</a></i> to describe and reason about another language, called the <i>object language</i>.
</p><p>Metalogic programming allows object-level and metalevel representations to be combined, as in natural language. For example, in the following program, the atomic formula <code>attends(Person, Meeting)</code> occurs both as an object-level formula, and as an argument of the metapredicates <code>prohibited</code> and <code>approved.</code>
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">prohibited</span><span class="p">(</span><span class="nf">attends</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="nv">Meeting</span><span class="p">))</span> <span class="p">:-</span>
<span class="o">not</span><span class="p">(</span><span class="nf">approved</span><span class="p">(</span><span class="nf">attends</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="nv">Meeting</span><span class="p">))).</span>

<span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="s s-Atom">scolding</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">attends</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="nv">Meeting</span><span class="p">),</span>
<span class="nf">lofty</span><span class="p">(</span><span class="nv">Person</span><span class="p">),</span> <span class="nf">prohibited</span><span class="p">(</span><span class="nf">attends</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="nv">Meeting</span><span class="p">)).</span>
<span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="s s-Atom">banishment</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">attends</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="nv">Meeting</span><span class="p">),</span>
<span class="nf">lowly</span><span class="p">(</span><span class="nv">Person</span><span class="p">),</span> <span class="nf">prohibited</span><span class="p">(</span><span class="nf">attends</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="nv">Meeting</span><span class="p">)).</span>

<span class="nf">approved</span><span class="p">(</span><span class="nf">attends</span><span class="p">(</span><span class="s s-Atom">alice</span><span class="p">,</span> <span class="s s-Atom">tea_party</span><span class="p">)).</span>
<span class="nf">attends</span><span class="p">(</span><span class="s s-Atom">mad_hatter</span><span class="p">,</span> <span class="s s-Atom">tea_party</span><span class="p">).</span>
<span class="nf">attends</span><span class="p">(</span><span class="s s-Atom">dormouse</span><span class="p">,</span> <span class="s s-Atom">tea_party</span><span class="p">).</span>

<span class="nf">lofty</span><span class="p">(</span><span class="s s-Atom">mad_hatter</span><span class="p">).</span>
<span class="nf">lowly</span><span class="p">(</span><span class="s s-Atom">dormouse</span><span class="p">).</span>

<span class="s s-Atom">?-</span> <span class="nf">should_receive_sanction</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span><span class="nv">Y</span><span class="p">).</span>
<span class="nv">Person</span> <span class="o">=</span> <span class="s s-Atom">mad_hatter</span><span class="p">,</span>
<span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">scolding</span><span class="p">.</span>
<span class="nv">Person</span> <span class="o">=</span> <span class="s s-Atom">dormouse</span><span class="p">,</span>
<span class="nv">Sanction</span> <span class="o">=</span> <span class="s s-Atom">banishment</span><span class="p">.</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Relationship_with_the_Computational-representational_understanding_of_mind">Relationship with the <a href="Computational-representational_understanding_of_mind" title="Computational-representational understanding of mind">Computational-representational understanding of mind</a></h3></div>
<p>In his popular Introduction to Cognitive Science,<sup id="cite_ref-44" class="reference"><a href="#cite_note-44"><span class="cite-bracket">[</span>44<span class="cite-bracket">]</span></a></sup> <a href="Paul_Thagard" title="Paul Thagard">Paul Thagard</a> includes logic and <a href="Rule-based_system" title="Rule-based system">rules</a> as alternative approaches to modelling human thinking. He argues that rules, which have the form <i>IF condition THEN action</i>, are "very similar" to logical conditionals, but they are simpler and have greater psychological plausibility (page 51). Among other differences between logic and rules, he argues that logic uses deduction, but rules use search (page 45) and can be used to reason either forward or backward (page 47). Sentences in logic "have to be interpreted as <i>universally true</i>", but rules can be <i>defaults</i>, which admit exceptions (page 44).
</p><p>He states that "unlike logic, rule-based systems can also easily represent strategic information
about what to do" (page 45). For example, "IF you want to go home for the weekend, and you have bus fare, THEN
you can catch a bus". He does not observe that the same strategy of reducing a goal to subgoals can be interpreted, in the manner of logic programming, as applying backward reasoning to a logical conditional:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">can_go</span><span class="p">(</span><span class="s s-Atom">you</span><span class="p">,</span> <span class="s s-Atom">home</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">have</span><span class="p">(</span><span class="s s-Atom">you</span><span class="p">,</span> <span class="s s-Atom">bus_fare</span><span class="p">),</span> <span class="nf">catch</span><span class="p">(</span><span class="s s-Atom">you</span><span class="p">,</span> <span class="s s-Atom">bus</span><span class="p">).</span>
</pre></div>
<p>All of these characteristics of rule-based systems - search, forward and backward reasoning, default reasoning, and goal-reduction - are also defining characteristics of logic programming. This suggests that Thagard's conclusion (page 56) that:
</p>
<blockquote>
<p>Much of human knowledge is naturally described in terms of rules, and many kinds of thinking such as planning can be modeled by rule-based systems.
</p>
</blockquote>
<p>also applies to logic programming.
</p><p>Other arguments showing how logic programming can be used to model aspects of human thinking are presented by <a href="Keith_Stenning" title="Keith Stenning">Keith Stenning</a> and <a href="Michiel_van_Lambalgen" title="Michiel van Lambalgen">Michiel van Lambalgen</a> in their book,
Human Reasoning and Cognitive Science.<sup id="cite_ref-45" class="reference"><a href="#cite_note-45"><span class="cite-bracket">[</span>45<span class="cite-bracket">]</span></a></sup> They show how the non-monotonic character of logic programs can be used to explain human performance on a variety of psychological tasks. They also show (page 237) that "closed–world reasoning in its guise as logic programming has an appealing neural implementation, unlike classical logic."
</p><p>In The Proper Treatment of Events,<sup id="cite_ref-46" class="reference"><a href="#cite_note-46"><span class="cite-bracket">[</span>46<span class="cite-bracket">]</span></a></sup>
Michiel van Lambalgen and Fritz Hamm investigate the use of constraint logic programming to code "temporal notions in natural language by looking at the way human beings construct time".
</p>
<div class="mw-heading mw-heading3"><h3 id="Knowledge_representation">Knowledge representation</h3></div>
<p>The use of logic to represent procedural knowledge and strategic information was one of the main goals contributing to the early development of logic programming. Moreover, it continues to be an important feature of the Prolog family of logic programming languages today. However, many applications of logic programming, including Prolog applications, increasingly focus on the use of logic to represent purely declarative knowledge. These applications include both the representation of general <a href="Commonsense_reasoning" title="Commonsense reasoning">commonsense</a> knowledge and the representation of domain specific <a href="Expert_system" title="Expert system">expertise</a>.
</p><p>Commonsense includes knowledge about cause and effect, as formalised, for example, in the <a href="Situation_calculus" title="Situation calculus">situation calculus</a>, <a href="Event_calculus" title="Event calculus">event calculus</a> and <a href="Action_language" title="Action language">action languages</a>. Here is a simplified example, which illustrates the main features of such formalisms. The first clause states that a fact holds immediately after an event initiates (or causes) the fact. The second clause is a <i><a href="Frame_problem" title="Frame problem">frame axiom</a></i>, which states that a fact that holds at a time continues to hold at the next time unless it is terminated by an event that happens at the time. This formulation allows more than one event to occur at the same time:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time2</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">happens</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">),</span>
<span class="nv">Time2</span> <span class="o">is</span> <span class="nv">Time1</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span>
<span class="nf">initiates</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Fact</span><span class="p">).</span>
<span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time2</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">happens</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">),</span>
<span class="nv">Time2</span> <span class="o">is</span> <span class="nv">Time1</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span>
<span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">),</span>
<span class="o">not</span><span class="p">(</span><span class="nf">terminated</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">)).</span>

<span class="nf">terminated</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">happens</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Time</span><span class="p">),</span>
<span class="nf">terminates</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Fact</span><span class="p">).</span>
</pre></div>
<p>Here <code>holds</code> is a meta-predicate, similar to <code>solve</code> above. However, whereas <code>solve</code> has only one argument, which applies to general clauses, the first argument of <code>holds</code> is a fact and the second argument is a time (or state). The atomic formula <code>holds(Fact, Time)</code> expresses that the <code>Fact</code> holds at the <code>Time</code>. Such time-varying facts are also called <a href="Fluent_(artificial_intelligence)" title="Fluent (artificial intelligence)">fluents</a>. The atomic formula <code>happens(Event, Time)</code> expresses that the Event happens at the <code>Time</code>.
</p><p>The following example illustrates how these clauses can be used to reason about causality in a toy <a href="Blocks_world" title="Blocks world">blocks world</a>. Here, in the initial state at time 0, a green block is on a table and a red block is stacked on the green block (like a traffic light). At time 0, the red block is moved to the table. At time 1, the green block is moved onto the red block. Moving an object onto a place terminates the fact that the object is on any place, and initiates the fact that the object is on the place to which it is moved:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">holds</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">holds</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">green_block</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>

<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">red_block</span><span class="p">),</span> <span class="mi">1</span><span class="p">).</span>

<span class="nf">initiates</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place</span><span class="p">),</span> <span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place</span><span class="p">)).</span>
<span class="nf">terminates</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place2</span><span class="p">),</span> <span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place1</span><span class="p">)).</span>

<span class="s s-Atom">?-</span> <span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time</span><span class="p">).</span>

<span class="nv">Fact</span> <span class="o">=</span> <span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span><span class="s s-Atom">table</span><span class="p">),</span>
<span class="nv">Time</span> <span class="o">=</span> <span class="mf">0.</span>
<span class="nv">Fact</span> <span class="o">=</span> <span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span><span class="s s-Atom">green_block</span><span class="p">),</span>
<span class="nv">Time</span> <span class="o">=</span> <span class="mf">0.</span>
<span class="nv">Fact</span> <span class="o">=</span> <span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span><span class="s s-Atom">table</span><span class="p">),</span>
<span class="nv">Time</span> <span class="o">=</span> <span class="mf">1.</span>
<span class="nv">Fact</span> <span class="o">=</span> <span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span><span class="s s-Atom">table</span><span class="p">),</span>
<span class="nv">Time</span> <span class="o">=</span> <span class="mf">1.</span>
<span class="nv">Fact</span> <span class="o">=</span> <span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span><span class="s s-Atom">red_block</span><span class="p">),</span>
<span class="nv">Time</span> <span class="o">=</span> <span class="mf">2.</span>
<span class="nv">Fact</span> <span class="o">=</span> <span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span><span class="s s-Atom">table</span><span class="p">),</span>
<span class="nv">Time</span> <span class="o">=</span> <span class="mf">2.</span>
</pre></div>
<p>Forward reasoning and backward reasoning generate the same answers to the goal <code>holds(Fact, Time)</code>. But forward reasoning generates fluents <i>progressively</i> in temporal order, and backward reasoning generates fluents <i>regressively</i>, as in the domain-specific use of <a href="Situation_calculus#Regression" title="Situation calculus">regression</a> in the <a href="Situation_calculus" title="Situation calculus">situation calculus</a>.<sup id="cite_ref-47" class="reference"><a href="#cite_note-47"><span class="cite-bracket">[</span>47<span class="cite-bracket">]</span></a></sup>
</p><p>Logic programming has also proved to be useful for representing domain-specific expertise in <a href="Expert_system" title="Expert system">expert systems</a>.<sup id="cite_ref-48" class="reference"><a href="#cite_note-48"><span class="cite-bracket">[</span>48<span class="cite-bracket">]</span></a></sup> But human expertise, like general-purpose commonsense, is mostly implicit and <a href="Tacit_knowledge" title="Tacit knowledge">tacit</a>, and it is often difficult to represent such implicit knowledge in explicit rules. This difficulty does not arise, however, when logic programs are used to represent the existing, explicit rules of a business organisation or legal authority.
</p><p>For example, here is a representation of a simplified version of the first sentence of the British Nationality Act, which states that a person who is born in the UK becomes a British citizen at the time of birth if a parent of the person is a British citizen at the time of birth:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">initiates</span><span class="p">(</span><span class="nf">birth</span><span class="p">(</span><span class="nv">Person</span><span class="p">),</span> <span class="nf">citizen</span><span class="p">(</span><span class="nv">Person</span><span class="p">,</span> <span class="s s-Atom">uk</span><span class="p">)):-</span>
<span class="nf">time_of</span><span class="p">(</span><span class="nf">birth</span><span class="p">(</span><span class="nv">Person</span><span class="p">),</span> <span class="nv">Time</span><span class="p">),</span>
<span class="nf">place_of</span><span class="p">(</span><span class="nf">birth</span><span class="p">(</span><span class="nv">Person</span><span class="p">),</span> <span class="s s-Atom">uk</span><span class="p">),</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">Another_Person</span><span class="p">,</span> <span class="nv">Person</span><span class="p">),</span>
<span class="nf">holds</span><span class="p">(</span><span class="nf">citizen</span><span class="p">(</span><span class="nv">Another_Person</span><span class="p">,</span> <span class="s s-Atom">uk</span><span class="p">),</span> <span class="nv">Time</span><span class="p">).</span>
</pre></div>
<p>Historically, the representation of a large portion of the British Nationality Act as a logic program in the 1980s<sup id="cite_ref-49" class="reference"><a href="#cite_note-49"><span class="cite-bracket">[</span>49<span class="cite-bracket">]</span></a></sup> was "hugely influential for the development of computational representations of legislation, showing how logic programming enables intuitively appealing representations that can be directly deployed to generate automatic inferences".<sup id="cite_ref-50" class="reference"><a href="#cite_note-50"><span class="cite-bracket">[</span>50<span class="cite-bracket">]</span></a></sup>
</p><p>More recently, the PROLEG system,<sup id="cite_ref-51" class="reference"><a href="#cite_note-51"><span class="cite-bracket">[</span>51<span class="cite-bracket">]</span></a></sup> initiated in 2009 and consisting of approximately 2500 rules and exceptions of civil code and supreme court case rules in Japan, has become possibly the largest legal rule base in the world.<sup id="cite_ref-:02_52-0" class="reference"><a href="#cite_note-:02-52"><span class="cite-bracket">[</span>52<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Variants_and_extensions">Variants and extensions</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Prolog">Prolog</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Prolog" title="Prolog">Prolog</a></div>
<p>The SLD resolution rule of inference is neutral about the order in which subgoals in the bodies of clauses can be <i>selected</i> for solution. For the sake of efficiency, Prolog restricts this order to the order in which the subgoals are written. SLD is also neutral about the strategy for searching the space of SLD proofs.
Prolog searches this space, top-down, depth-first, trying different clauses for solving the same (sub)goal in the order in which the clauses are written.
</p><p>This search strategy has the advantage that the current branch of the tree can be represented efficiently by a <a href="Stack_(abstract_data_type)" title="Stack (abstract data type)">stack</a>. When a goal clause at the top of the stack is reduced to a new goal clause, the new goal clause is pushed onto the top of the stack. When the selected subgoal in the goal clause at the top of the stack cannot be solved, the search strategy <i><a href="Backtracking" title="Backtracking">backtracks</a></i>, removing the goal clause from the top of the stack, and retrying the attempted solution of the selected subgoal in the previous goal clause using the next clause that matches the selected subgoal.
</p><p>Backtracking can be restricted by using a subgoal, called <i><a href="Cut_(logic_programming)" title="Cut (logic programming)">cut</a></i>, written as&nbsp;!, which always succeeds but cannot be backtracked. Cut can be used to improve efficiency, but can also interfere with the logical meaning of clauses. In many cases, the use of cut can be replaced by negation as failure. In fact, negation as failure can be defined in Prolog, by using cut, together with any literal, say <i>fail</i>, that unifies with the head of no clause:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="o">not</span><span class="p">(</span><span class="nv">P</span><span class="p">)</span> <span class="p">:-</span> <span class="nv">P</span><span class="p">,</span> <span class="p">!,</span> <span class="s s-Atom">fail</span><span class="p">.</span>
<span class="o">not</span><span class="p">(</span><span class="nv">P</span><span class="p">).</span>
</pre></div>
<p>Prolog provides other features, in addition to cut, that do not have a logical interpretation. These include the built-in predicates <i>assert</i> and <i>retract</i> for destructively updating the state of the program during program execution.
</p><p>For example, the <a href="#Knowledge_representation">toy blocks world example above</a> can be implemented without frame axioms using destructive change of state:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">).</span>
<span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">green_block</span><span class="p">).</span>

<span class="nf">move</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place2</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">retract</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place1</span><span class="p">)),</span>
<span class="nf">assert</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place2</span><span class="p">).</span>
</pre></div>
<p>The sequence of move events and the resulting locations of the blocks can be computed by executing the query:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="s s-Atom">?-</span> <span class="nf">move</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="nf">move</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">red_block</span><span class="p">),</span> <span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place</span><span class="p">).</span>

<span class="nv">Object</span> <span class="o">=</span> <span class="s s-Atom">red_block</span><span class="p">,</span>
<span class="nv">Place</span> <span class="o">=</span> <span class="s s-Atom">table</span><span class="p">.</span>
<span class="nv">Object</span> <span class="o">=</span> <span class="s s-Atom">green_block</span><span class="p">,</span>
<span class="nv">Place</span> <span class="o">=</span> <span class="s s-Atom">red_block</span><span class="p">.</span>
</pre></div>
<p>Various extensions of logic programming have been developed to provide a logical framework for such destructive change of state.<sup id="cite_ref-TL_53-0" class="reference"><a href="#cite_note-TL-53"><span class="cite-bracket">[</span>53<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-54" class="reference"><a href="#cite_note-54"><span class="cite-bracket">[</span>54<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-55" class="reference"><a href="#cite_note-55"><span class="cite-bracket">[</span>55<span class="cite-bracket">]</span></a></sup>
</p><p>The broad range of Prolog applications, both in isolation and in combination with other languages is highlighted in the Year of Prolog Book,<sup id="cite_ref-Prolog_Book_21-1" class="reference"><a href="#cite_note-Prolog_Book-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup> celebrating the 50 year anniversary of Prolog in 2022.
</p><p>Prolog has also contributed to the development of other programming languages, including <a href="Algebraic_Logic_Functional_programming_language" title="Algebraic Logic Functional programming language">ALF</a>, <a href="Fril" title="Fril">Fril</a>, <a href="G%C3%B6del_(programming_language)" title="Gödel (programming language)">Gödel</a>, <a href="Mercury_programming_language" class="mw-redirect" title="Mercury programming language">Mercury</a>, <a href="Oz_(programming_language)" title="Oz (programming language)">Oz</a>, <a href="Ciao_(programming_language)" title="Ciao (programming language)">Ciao</a>, <a href="Visual_Prolog" title="Visual Prolog">Visual Prolog</a>, <a href="XSB" title="XSB">XSB</a>, and <a href="%CE%9BProlog" title="ΛProlog">λProlog</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Constraint_logic_programming">Constraint logic programming</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Constraint_logic_programming" title="Constraint logic programming">Constraint logic programming</a></div>
<p><a href="Constraint_logic_programming" title="Constraint logic programming">Constraint logic programming</a> (CLP) combines Horn clause logic programming with <a href="Constraint_solving" class="mw-redirect" title="Constraint solving">constraint solving</a>. It extends Horn clauses by allowing some predicates, declared as constraint predicates, to occur as literals in the body of a clause. Constraint predicates are not defined by the facts and rules in the program, but are predefined by some domain-specific model-theoretic structure or theory.
</p><p>Procedurally, subgoals whose predicates are defined by the program are solved by goal-reduction, as in ordinary logic programming, but constraints are simplified and checked for satisfiability by a domain-specific constraint-solver, which implements the semantics of the constraint predicates. An initial problem is solved by reducing it to a satisfiable conjunction of constraints.
</p><p>Interestingly, the first version of Prolog already included a constraint predicate dif(term1, term2), from Philippe Roussel's 1972 PhD thesis, which succeeds if both of its arguments are different terms, but which is delayed if either of the terms contains a variable.<sup id="cite_ref-:02_52-1" class="reference"><a href="#cite_note-:02-52"><span class="cite-bracket">[</span>52<span class="cite-bracket">]</span></a></sup>
</p><p>The following constraint logic program represents a toy temporal database of <code>john's</code> history as a teacher:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">teaches</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">hardware</span><span class="p">,</span> <span class="nv">T</span><span class="p">)</span> <span class="p">:-</span> <span class="mi">1990</span> <span class="s s-Atom">≤</span> <span class="nv">T</span><span class="p">,</span> <span class="nv">T</span> <span class="o">&lt;</span> <span class="mf">1999.</span>
<span class="nf">teaches</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">software</span><span class="p">,</span> <span class="nv">T</span><span class="p">)</span> <span class="p">:-</span> <span class="mi">1999</span> <span class="s s-Atom">≤</span> <span class="nv">T</span><span class="p">,</span> <span class="nv">T</span> <span class="o">&lt;</span> <span class="mf">2005.</span>
<span class="nf">teaches</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">logic</span><span class="p">,</span> <span class="nv">T</span><span class="p">)</span> <span class="p">:-</span> <span class="mi">2005</span> <span class="s s-Atom">≤</span> <span class="nv">T</span><span class="p">,</span> <span class="nv">T</span> <span class="s s-Atom">≤</span> <span class="mf">2012.</span>
<span class="nf">rank</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">instructor</span><span class="p">,</span> <span class="nv">T</span><span class="p">)</span> <span class="p">:-</span> <span class="mi">1990</span> <span class="s s-Atom">≤</span> <span class="nv">T</span><span class="p">,</span> <span class="nv">T</span> <span class="o">&lt;</span> <span class="mf">2010.</span>
<span class="nf">rank</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">professor</span><span class="p">,</span> <span class="nv">T</span><span class="p">)</span> <span class="p">:-</span> <span class="mi">2010</span> <span class="s s-Atom">≤</span> <span class="nv">T</span><span class="p">,</span> <span class="nv">T</span> <span class="o">&lt;</span> <span class="mf">2014.</span>
</pre></div>
<p>Here <code>≤</code> and <code>&lt;</code> are constraint predicates, with their usual intended semantics. The following goal clause queries the database to find out when <code>john</code> both taught <code>logic</code> and was a <code>professor</code>:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="s s-Atom">?-</span> <span class="nf">teaches</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">logic</span><span class="p">,</span> <span class="nv">T</span><span class="p">),</span> <span class="nf">rank</span><span class="p">(</span><span class="s s-Atom">john</span><span class="p">,</span> <span class="s s-Atom">professor</span><span class="p">,</span> <span class="nv">T</span><span class="p">).</span>
</pre></div>
<p>The solution
<code>
2010 ≤ T, T ≤ 2012
</code>
results from simplifying the constraints
<code>
2005 ≤ T, T ≤ 2012, 2010 ≤ T, T &lt; 2014.
</code>
</p><p>Constraint logic programming has been used to solve problems in such fields as <a href="Civil_engineering" title="Civil engineering">civil engineering</a>, <a href="Mechanical_engineering" title="Mechanical engineering">mechanical engineering</a>, <a href="Digital_circuit" class="mw-redirect" title="Digital circuit">digital circuit</a> verification, <a href="Automated_timetabling" class="mw-redirect" title="Automated timetabling">automated timetabling</a>, <a href="Air_traffic_control" title="Air traffic control">air traffic control</a>, and finance. It is closely related to <a href="Abductive_logic_programming" title="Abductive logic programming">abductive logic programming</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Datalog">Datalog</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Datalog" title="Datalog">Datalog</a></div>
<p>Datalog is a database definition language, which combines a relational view of data, as in <a href="Relational_database" title="Relational database">relational databases</a>, with a logical view, as in logic programming.
</p><p>Relational databases use a relational calculus or relational algebra, with <a href="Relational_database#Relational_operations" title="Relational database">relational operations</a>, such as <i>union</i>, <i>intersection</i>, <i>set difference</i> and <i>cartesian product</i> to specify queries, which access a database. Datalog uses logical connectives, such as <i>or</i>, <i>and</i> and <i>not</i> in the bodies of rules to define relations as part of the database itself.
</p><p>It was recognized early in the development of relational databases that recursive queries cannot be expressed in either relational algebra or relational calculus, and that this defficiency can be remedied by introducing a least-fixed-point operator.<sup id="cite_ref-56" class="reference"><a href="#cite_note-56"><span class="cite-bracket">[</span>56<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-57" class="reference"><a href="#cite_note-57"><span class="cite-bracket">[</span>57<span class="cite-bracket">]</span></a></sup> In contrast, recursive relations can be defined naturally by rules in logic programs, without the need for any new logical connectives or operators.
</p><p>Datalog differs from more general logic programming by having only constants and variables as terms. Moreover, all facts are variable-free, and rules are restricted, so that if they are executed bottom-up, then the derived facts are also variable-free.
</p><p>For example, consider the family database:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">mother_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">charles</span><span class="p">).</span>
<span class="nf">father_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">father_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">mother_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">father_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">X</span><span class="p">).</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Z</span><span class="p">),</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="nv">Z</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
</pre></div>
<p>Bottom-up execution derives the following set of additional facts and terminates:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">parent_child</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">charles</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">parent_child</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>

<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">charles</span><span class="p">).</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="s s-Atom">charles</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>

<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">william</span><span class="p">).</span>
<span class="nf">ancestor_descendant</span><span class="p">(</span><span class="s s-Atom">elizabeth</span><span class="p">,</span> <span class="s s-Atom">harry</span><span class="p">).</span>
</pre></div>
<p>Top-down execution derives the same answers to the query:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="s s-Atom">?-</span> <span class="nf">ancestor_descendant</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
</pre></div>
<p>But then it goes into an infinite loop. However, top-down execution with <a href="Tabled_logic_programming" title="Tabled logic programming">tabling</a> gives the same answers and terminates without looping.
</p>
<div class="mw-heading mw-heading3"><h3 id="Answer_set_programming">Answer set programming</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Answer_Set_Programming" class="mw-redirect" title="Answer Set Programming">Answer Set Programming</a></div>
<p>Like Datalog, Answer Set programming (ASP) is not Turing-complete. Moreover, instead of separating goals (or queries) from the program to be used in solving the goals, ASP treats the whole program as a goal, and solves the goal by generating a stable model that makes the goal true. For this purpose, it uses the <a href="Stable_model_semantics" title="Stable model semantics">stable model semantics</a>, according to which a logic program can have zero, one or more intended models. For example, the following program represents a degenerate variant of the map colouring problem of colouring two countries red or green:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span>
<span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span>
<span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span>
<span class="nf">colour</span><span class="p">(</span><span class="nv">C</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">country</span><span class="p">(</span><span class="nv">C</span><span class="p">),</span> <span class="o">not</span><span class="p">(</span><span class="nf">colour</span><span class="p">(</span><span class="nv">C</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">)).</span>
<span class="nf">colour</span><span class="p">(</span><span class="nv">C</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">)</span> <span class="p">:-</span> <span class="nf">country</span><span class="p">(</span><span class="nv">C</span><span class="p">),</span> <span class="o">not</span><span class="p">(</span><span class="nf">colour</span><span class="p">(</span><span class="nv">C</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">)).</span>
</pre></div>
<p>The problem has four solutions represented by four stable models:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span> <span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">).</span>

<span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span> <span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">).</span>

<span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span> <span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">).</span>

<span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span> <span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">).</span>
</pre></div>
<p>To represent the standard version of the map colouring problem, we need to add a constraint that two adjacent countries cannot be coloured the same colour. In ASP, this constraint can be written as a clause of the form:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="p">:-</span> <span class="nf">country</span><span class="p">(</span><span class="nv">C1</span><span class="p">),</span> <span class="nf">country</span><span class="p">(</span><span class="nv">C2</span><span class="p">),</span> <span class="nf">adjacent</span><span class="p">(</span><span class="nv">C1</span><span class="p">,</span> <span class="nv">C2</span><span class="p">),</span> <span class="nf">colour</span><span class="p">(</span><span class="nv">C1</span><span class="p">,</span> <span class="nv">X</span><span class="p">),</span> <span class="nf">colour</span><span class="p">(</span><span class="nv">C2</span><span class="p">,</span> <span class="nv">X</span><span class="p">).</span>
</pre></div>
<p>With the addition of this constraint, the problem now has only two solutions:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span> <span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">).</span>

<span class="nf">country</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">).</span> <span class="nf">country</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">adjacent</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">iz</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">oz</span><span class="p">,</span> <span class="s s-Atom">green</span><span class="p">).</span> <span class="nf">colour</span><span class="p">(</span><span class="s s-Atom">iz</span><span class="p">,</span> <span class="s s-Atom">red</span><span class="p">).</span>
</pre></div>
<p>The addition of constraints of the form <code>:- Body.</code> eliminates models in which <code>Body</code> is true.
</p><p>Confusingly, <i>constraints in ASP</i> are different from <i>constraints in CLP</i>. Constraints in CLP are predicates that qualify answers to queries (and solutions of goals). Constraints in ASP are clauses that eliminate models that would otherwise satisfy goals. Constraints in ASP are like integrity constraints in databases.
</p><p>This combination of ordinary logic programming clauses and constraint clauses illustrates the generate-and-test methodology of problem solving in ASP: The ordinary clauses define a search space of possible solutions, and the constraints filter out unwanted solutions.<sup id="cite_ref-58" class="reference"><a href="#cite_note-58"><span class="cite-bracket">[</span>58<span class="cite-bracket">]</span></a></sup>
</p><p>Most implementations of ASP proceed in two steps: First they instantiate the program in all possible ways, reducing it to a propositional logic program (known as <i>grounding</i>). Then they apply a propositional logic problem solver, such as the <a href="DPLL_algorithm" title="DPLL algorithm">DPLL algorithm</a> or a <a href="Boolean_SAT_solver" class="mw-redirect" title="Boolean SAT solver">Boolean SAT solver</a>. However, some implementations, such as s(CASP)<sup id="cite_ref-59" class="reference"><a href="#cite_note-59"><span class="cite-bracket">[</span>59<span class="cite-bracket">]</span></a></sup> use a goal-directed, top-down, SLD resolution-like procedure without
grounding.
</p>
<div class="mw-heading mw-heading3"><h3 id="Abductive_logic_programming">Abductive logic programming</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Abductive_logic_programming" title="Abductive logic programming">Abductive logic programming</a></div>
<p><a href="Abductive_logic_programming" title="Abductive logic programming">Abductive logic programming</a><sup id="cite_ref-60" class="reference"><a href="#cite_note-60"><span class="cite-bracket">[</span>60<span class="cite-bracket">]</span></a></sup> (ALP), like CLP, extends normal logic programming by allowing the bodies of clauses to contain literals whose predicates are not defined by clauses. In ALP, these predicates are declared as <i>abducible</i> (or <i>assumable</i>), and are used as in <a href="Abductive_reasoning#Logic-based_abduction" title="Abductive reasoning">abductive reasoning</a> to explain observations, or more generally to add new facts to the program (as assumptions) to solve goals.
</p><p>For example, suppose we are given an initial state in which a red block is on a green block on a table at time 0:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">holds</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">holds</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">green_block</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
</pre></div>
<p>Suppose we are also given the goal:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="s s-Atom">?-</span> <span class="nf">holds</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span><span class="s s-Atom">red_block</span><span class="p">),</span> <span class="mi">3</span><span class="p">),</span> <span class="nf">holds</span><span class="p">(</span><span class="nf">on</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span><span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">3</span><span class="p">).</span>
</pre></div>
<p>The goal can represent an observation, in which case a solution is an explanation of the observation. Or the goal can represent a desired future state of affairs, in which case a solution is a plan for achieving the goal.<sup id="cite_ref-61" class="reference"><a href="#cite_note-61"><span class="cite-bracket">[</span>61<span class="cite-bracket">]</span></a></sup>
</p><p>We can use the rules for cause and effect presented earlier to solve the goal, by treating the <code>happens</code> predicate as abducible:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time2</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">happens</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">),</span>
<span class="nv">Time2</span> <span class="o">is</span> <span class="nv">Time1</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span>
<span class="nf">initiates</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Fact</span><span class="p">).</span>
<span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time2</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">happens</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">),</span>
<span class="nv">Time2</span> <span class="o">is</span> <span class="nv">Time1</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span>
<span class="nf">holds</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">),</span>
<span class="o">not</span><span class="p">(</span><span class="nf">terminated</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time1</span><span class="p">)).</span>
<span class="nf">terminated</span><span class="p">(</span><span class="nv">Fact</span><span class="p">,</span> <span class="nv">Time</span><span class="p">)</span> <span class="p">:-</span>
<span class="nf">happens</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Time</span><span class="p">),</span>
<span class="nf">terminates</span><span class="p">(</span><span class="nv">Event</span><span class="p">,</span> <span class="nv">Fact</span><span class="p">).</span>

<span class="nf">initiates</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place</span><span class="p">),</span> <span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place</span><span class="p">)).</span>
<span class="nf">terminates</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place2</span><span class="p">),</span> <span class="nf">on</span><span class="p">(</span><span class="nv">Object</span><span class="p">,</span> <span class="nv">Place1</span><span class="p">)).</span>
</pre></div>
<p>ALP solves the goal by reasoning backwards and adding assumptions to the program, to solve abducible subgoals. In this case there are many alternative solutions, including:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="s s-Atom">tick</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">red_block</span><span class="p">),</span> <span class="mi">2</span><span class="p">).</span>
</pre></div>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">happens</span><span class="p">(</span><span class="s s-Atom">tick</span><span class="p">,</span><span class="mi">0</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">1</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">red_block</span><span class="p">),</span> <span class="mi">2</span><span class="p">).</span>
</pre></div>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">red_block</span><span class="p">),</span> <span class="mi">1</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="s s-Atom">tick</span><span class="p">,</span> <span class="mi">2</span><span class="p">).</span>
</pre></div>
<p>Here <code class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><span class="s s-Atom">tick</span></code> is an event that marks the passage of time without initiating or terminating any fluents.
</p><p>There are also solutions in which the two <code>move</code> events happen at the same time. For example:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">red_block</span><span class="p">,</span> <span class="s s-Atom">table</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="s s-Atom">green_block</span><span class="p">,</span> <span class="s s-Atom">red_block</span><span class="p">),</span> <span class="mi">0</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="s s-Atom">tick</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span>
<span class="nf">happens</span><span class="p">(</span><span class="s s-Atom">tick</span><span class="p">,</span> <span class="mi">2</span><span class="p">).</span>
</pre></div>
<p>Such solutions, if not desired, can be removed by adding an integrity constraint, which is like a constraint clause in ASP:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="p">:-</span> <span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="nv">Block1</span><span class="p">,</span> <span class="nv">Place</span><span class="p">),</span> <span class="nv">Time</span><span class="p">),</span> <span class="nf">happens</span><span class="p">(</span><span class="nf">move</span><span class="p">(</span><span class="nv">Block2</span><span class="p">,</span> <span class="nv">Block1</span><span class="p">),</span> <span class="nv">Time</span><span class="p">).</span>
</pre></div>
<p>Abductive logic programming has been used for fault diagnosis, planning, natural language processing and machine learning. It has also been used to interpret negation as failure as a form of abductive reasoning.<sup id="cite_ref-62" class="reference"><a href="#cite_note-62"><span class="cite-bracket">[</span>62<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Inductive_logic_programming">Inductive logic programming</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Inductive_logic_programming" title="Inductive logic programming">Inductive logic programming</a></div>
<p>Inductive logic programming (ILP) is an approach to <a href="Machine_learning" title="Machine learning">machine learning</a> that <a href="Inductive_reasoning" title="Inductive reasoning">induces</a> logic programs as hypothetical generalisations of positive and negative examples. Given a logic program representing background knowledge and positive examples together with constraints representing negative examples, an ILP system induces a logic program that generalises the positive examples while excluding the negative examples.
</p><p>ILP is similar to ALP, in that both can be viewed as generating hypotheses to explain observations, and as employing constraints to exclude undesirable hypotheses. But in ALP the hypotheses are variable-free facts, and in ILP the hypotheses are general rules.<sup id="cite_ref-63" class="reference"><a href="#cite_note-63"><span class="cite-bracket">[</span>63<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-64" class="reference"><a href="#cite_note-64"><span class="cite-bracket">[</span>64<span class="cite-bracket">]</span></a></sup>
</p><p>For example, given only background knowledge of the mother_child and father_child relations, and suitable examples of the grandparent_child relation, current ILP systems can generate the definition of grandparent_child, inventing an auxiliary predicate, which can be interpreted as the parent_child relation:<sup id="cite_ref-65" class="reference"><a href="#cite_note-65"><span class="cite-bracket">[</span>65<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">grandparent_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">):-</span> <span class="nf">auxiliary</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Z</span><span class="p">),</span> <span class="nf">auxiliary</span><span class="p">(</span><span class="nv">Z</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nf">auxiliary</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">):-</span> <span class="nf">mother_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
<span class="nf">auxiliary</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">):-</span> <span class="nf">father_child</span><span class="p">(</span><span class="nv">X</span><span class="p">,</span> <span class="nv">Y</span><span class="p">).</span>
</pre></div>
<p>Stuart Russell<sup id="cite_ref-66" class="reference"><a href="#cite_note-66"><span class="cite-bracket">[</span>66<span class="cite-bracket">]</span></a></sup> has referred to such invention of new concepts as the most important step needed for reaching human-level AI.
</p><p>Recent work in ILP, combining logic programming, learning and probability, has given rise to the fields of <a href="Statistical_relational_learning" title="Statistical relational learning">statistical relational learning</a> and <a href="Probabilistic_inductive_logic_programming" class="mw-redirect" title="Probabilistic inductive logic programming">probabilistic inductive logic programming</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Concurrent_logic_programming">Concurrent logic programming</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Concurrent_logic_programming" title="Concurrent logic programming">Concurrent logic programming</a></div>
<p>Concurrent logic programming integrates concepts of logic programming with <a href="Concurrent_programming" class="mw-redirect" title="Concurrent programming">concurrent programming</a>. Its development was given a big impetus in the 1980s by its choice for the systems programming language of the <a href="Fifth_generation_computer" class="mw-redirect" title="Fifth generation computer">Japanese Fifth Generation Project (FGCS)</a>.<sup id="cite_ref-67" class="reference"><a href="#cite_note-67"><span class="cite-bracket">[</span>67<span class="cite-bracket">]</span></a></sup>
</p><p>A concurrent logic program is a set of guarded <a href="Horn_clauses" class="mw-redirect" title="Horn clauses">Horn clauses</a> of the form:
</p>
<dl><dd><dl><dd><code>H&nbsp;:- G<sub>1</sub>, ..., G<sub>n</sub> | B<sub>1</sub>, ..., B<sub>n</sub>.</code></dd></dl></dd></dl>
<p>The conjunction <code>G<sub>1</sub>, ... , G<sub>n</sub></code> is called the <a href="Guard_(computer_science)" title="Guard (computer science)">guard</a> of the clause, and <span class="nounderlines" style="border: 1px solid var(--border-color-muted,#ddd); color: var(--color-base,#202122); background-color: var( --background-color-neutral-subtle, #fdfdfd); padding: 1px 1px;">|</span> is the commitment operator. Declaratively, guarded Horn clauses are read as ordinary logical implications:
</p>
<dl><dd><dl><dd><code>H if G<sub>1</sub> and ... and G<sub>n</sub> and B<sub>1</sub> and ... and B<sub>n</sub>.</code></dd></dl></dd></dl>
<p>However, procedurally, when there are several clauses whose heads <code>H</code> match a given goal, then all of the clauses are executed in parallel, checking whether their guards <code>G<sub>1</sub>, ... , G<sub>n</sub></code> hold. If the guards of more than one clause hold, then a committed choice is made to one of the clauses, and execution proceeds with the subgoals <code>B<sub>1</sub>, ..., B<sub>n</sub></code> of the chosen clause. These subgoals can also be executed in parallel. Thus concurrent logic programming implements a form of "don't care nondeterminism", rather than "don't know nondeterminism".
</p><p>For example, the following concurrent logic program defines a predicate <code>shuffle(Left, Right, Merge)</code>, which can be used to shuffle two lists <code>Left</code> and <code>Right</code>, combining them into a single list <code>Merge</code> that preserves the ordering of the two lists <code>Left</code> and <code>Right</code>:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">shuffle</span><span class="p">([],</span> <span class="p">[],</span> <span class="p">[]).</span>
<span class="nf">shuffle</span><span class="p">(</span><span class="nv">Left</span><span class="p">,</span> <span class="nv">Right</span><span class="p">,</span> <span class="nv">Merge</span><span class="p">)</span> <span class="p">:-</span>
<span class="nv">Left</span> <span class="o">=</span> <span class="p">[</span><span class="nv">First</span> <span class="p">|</span> <span class="nv">Rest</span><span class="p">]</span> <span class="p">|</span>
<span class="nv">Merge</span> <span class="o">=</span> <span class="p">[</span><span class="nv">First</span> <span class="p">|</span> <span class="nv">ShortMerge</span><span class="p">],</span>
<span class="nf">shuffle</span><span class="p">(</span><span class="nv">Rest</span><span class="p">,</span> <span class="nv">Right</span><span class="p">,</span> <span class="nv">ShortMerge</span><span class="p">).</span>
<span class="nf">shuffle</span><span class="p">(</span><span class="nv">Left</span><span class="p">,</span> <span class="nv">Right</span><span class="p">,</span> <span class="nv">Merge</span><span class="p">)</span> <span class="p">:-</span>
<span class="nv">Right</span> <span class="o">=</span> <span class="p">[</span><span class="nv">First</span> <span class="p">|</span> <span class="nv">Rest</span><span class="p">]</span> <span class="p">|</span>
<span class="nv">Merge</span> <span class="o">=</span> <span class="p">[</span><span class="nv">First</span> <span class="p">|</span> <span class="nv">ShortMerge</span><span class="p">],</span>
<span class="nf">shuffle</span><span class="p">(</span><span class="nv">Left</span><span class="p">,</span> <span class="nv">Rest</span><span class="p">,</span> <span class="nv">ShortMerge</span><span class="p">).</span>
</pre></div>
<p>Here, <code>[]</code> represents the empty list, and <code>[Head | Tail]</code> represents a list with first element <code>Head</code> followed by list <code>Tail</code>, as in Prolog. (Notice that the first occurrence of <span class="nounderlines" style="border: 1px solid var(--border-color-muted,#ddd); color: var(--color-base,#202122); background-color: var( --background-color-neutral-subtle, #fdfdfd); padding: 1px 1px;">|</span> in the second and third clauses is the list constructor, whereas the second occurrence of <span class="nounderlines" style="border: 1px solid var(--border-color-muted,#ddd); color: var(--color-base,#202122); background-color: var( --background-color-neutral-subtle, #fdfdfd); padding: 1px 1px;">|</span> is the commitment operator.) The program can be used, for example, to shuffle the lists <code>[ace, queen, king]</code> and <code>[1, 4, 2]</code> by invoking the goal clause:
</p>
<div class="mw-highlight mw-highlight-lang-prolog mw-content-ltr" dir="ltr"><pre><span class="nf">shuffle</span><span class="p">([</span><span class="s s-Atom">ace</span><span class="p">,</span> <span class="s s-Atom">queen</span><span class="p">,</span> <span class="s s-Atom">king</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">],</span> <span class="nv">Merge</span><span class="p">).</span>
</pre></div>
<p>The program will non-deterministically generate a single solution, for example <code>Merge = [ace, queen, 1, king, 4, 2]</code>.
</p><p><a href="Carl_Hewitt" title="Carl Hewitt">Carl Hewitt</a> has argued<sup id="cite_ref-Hewitt_68-0" class="reference"><a href="#cite_note-Hewitt-68"><span class="cite-bracket">[</span>68<span class="cite-bracket">]</span></a></sup> that, because of the <a href="Indeterminacy_in_concurrent_computation" title="Indeterminacy in concurrent computation">indeterminacy of concurrent computation</a>, concurrent logic programming cannot implement general concurrency. However, according to the logical semantics, any result of a computation of a concurrent logic program is a logical consequence of the program, even though not all logical consequences can be derived.
</p>
<div class="mw-heading mw-heading3"><h3 id="Concurrent_constraint_logic_programming">Concurrent constraint logic programming</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Concurrent_constraint_logic_programming" title="Concurrent constraint logic programming">Concurrent constraint logic programming</a></div>
<p><a href="Concurrent_constraint_logic_programming" title="Concurrent constraint logic programming">Concurrent constraint logic programming</a><sup id="cite_ref-69" class="reference"><a href="#cite_note-69"><span class="cite-bracket">[</span>69<span class="cite-bracket">]</span></a></sup> combines concurrent logic programming and <a href="Constraint_logic_programming" title="Constraint logic programming">constraint logic programming</a>, using constraints to control concurrency. A clause can contain a guard, which is a set of constraints that may block the applicability of the clause. When the guards of several clauses are satisfied, concurrent constraint logic programming makes a committed choice to use only one.
</p>
<div class="mw-heading mw-heading3"><h3 id="Higher-order_logic_programming">Higher-order logic programming</h3></div>
<p>Several researchers have extended logic programming with <a href="Higher-order_programming" title="Higher-order programming">higher-order programming</a> features derived from <a href="Higher-order_logic" title="Higher-order logic">higher-order logic</a>, such as predicate variables. Such languages include the Prolog extensions <a href="HiLog" title="HiLog">HiLog</a><sup id="cite_ref-hilog-jlp_70-0" class="reference"><a href="#cite_note-hilog-jlp-70"><span class="cite-bracket">[</span>70<span class="cite-bracket">]</span></a></sup> and <a href="%CE%9BProlog" title="ΛProlog">λProlog</a>.<sup id="cite_ref-71" class="reference"><a href="#cite_note-71"><span class="cite-bracket">[</span>71<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Linear_logic_programming">Linear logic programming</h3></div>
<p>Basing logic programming within <a href="Linear_logic" title="Linear logic">linear logic</a> has resulted in the design of logic programming languages that are considerably more expressive than those based on classical logic. Horn clause programs can only represent state change by the change in arguments to predicates. In linear logic programming, one can use the ambient linear logic to support state change. Some early designs of logic programming languages based on linear logic include LO,<sup id="cite_ref-72" class="reference"><a href="#cite_note-72"><span class="cite-bracket">[</span>72<span class="cite-bracket">]</span></a></sup> Lolli,<sup id="cite_ref-73" class="reference"><a href="#cite_note-73"><span class="cite-bracket">[</span>73<span class="cite-bracket">]</span></a></sup> ACL,<sup id="cite_ref-74" class="reference"><a href="#cite_note-74"><span class="cite-bracket">[</span>74<span class="cite-bracket">]</span></a></sup> and Forum.<sup id="cite_ref-75" class="reference"><a href="#cite_note-75"><span class="cite-bracket">[</span>75<span class="cite-bracket">]</span></a></sup> Forum provides a goal-directed interpretation of all linear logic.
</p>
<div class="mw-heading mw-heading3"><h3 id="Object-oriented_logic_programming">Object-oriented logic programming</h3></div>
<p><a href="F-logic" title="F-logic">F-logic</a><sup id="cite_ref-76" class="reference"><a href="#cite_note-76"><span class="cite-bracket">[</span>76<span class="cite-bracket">]</span></a></sup> extends logic programming with objects and the frame syntax.
</p><p><a href="Logtalk" title="Logtalk">Logtalk</a><sup id="cite_ref-77" class="reference"><a href="#cite_note-77"><span class="cite-bracket">[</span>77<span class="cite-bracket">]</span></a></sup> extends the Prolog programming language with support for objects, protocols, and other OOP concepts. It supports most standard-compliant Prolog systems as backend compilers.
</p>
<div class="mw-heading mw-heading3"><h3 id="Transaction_logic_programming">Transaction logic programming</h3></div>
<p><a href="Transaction_logic" title="Transaction logic">Transaction logic</a><sup id="cite_ref-TL_53-1" class="reference"><a href="#cite_note-TL-53"><span class="cite-bracket">[</span>53<span class="cite-bracket">]</span></a></sup> is an extension of logic programming with a logical theory of state-modifying updates. It has both a model-theoretic semantics and a procedural one. An implementation of a subset of Transaction logic is available in the <a href="Flora-2" title="Flora-2">Flora-2</a><sup id="cite_ref-78" class="reference"><a href="#cite_note-78"><span class="cite-bracket">[</span>78<span class="cite-bracket">]</span></a></sup> system. Other prototypes are also <a href="Transaction_logic" title="Transaction logic">available</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Automated_theorem_proving" title="Automated theorem proving">Automated theorem proving</a></li>
<li><a href="Boolean_satisfiability_problem" title="Boolean satisfiability problem">Boolean satisfiability problem</a></li>
<li><a href="Constraint_logic_programming" title="Constraint logic programming">Constraint logic programming</a></li>
<li><a href="Control_theory" title="Control theory">Control theory</a></li>
<li><a href="Datalog" title="Datalog">Datalog</a></li>
<li><a href="Fril" title="Fril">Fril</a></li>
<li><a href="Functional_programming" title="Functional programming">Functional programming</a></li>
<li><a href="Fuzzy_logic" title="Fuzzy logic">Fuzzy logic</a></li>
<li><a href="Inductive_logic_programming" title="Inductive logic programming">Inductive logic programming</a></li>
<li><a href="Linear_logic" title="Linear logic">Linear logic</a></li>
<li><a href="Logic_in_computer_science" title="Logic in computer science">Logic in computer science</a> (includes <a href="Formal_methods" title="Formal methods">Formal methods</a>)</li>
<li>Logic programming languages</li>
<li><a href="Programmable_logic_controller" title="Programmable logic controller">Programmable logic controller</a></li>
<li><a href="R%2B%2B" title="R++">R++</a></li>
<li><a href="Reasoning_system" title="Reasoning system">Reasoning system</a></li>
<li><a href="Rule-based_machine_learning" title="Rule-based machine learning">Rule-based machine learning</a></li>
<li><a href="Satisfiability" title="Satisfiability">Satisfiability</a></li>
<li><a href="Syntax_and_semantics_of_logic_programming" title="Syntax and semantics of logic programming">Syntax and semantics of logic programming</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Citations">Citations</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFTärnlund1977" class="citation journal cs1">Tärnlund, S.Å. (1977). "Horn clause computability". <i><a href="BIT_Numerical_Mathematics" title="BIT Numerical Mathematics">BIT Numerical Mathematics</a></i>. <b>17</b> (2): <span class="nowrap">215–</span>226. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2FBF01932293">10.1007/BF01932293</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:32577496">32577496</a>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFAndrékaNémeti1978" class="citation journal cs1">Andréka, H.; Németi, I. (1978). <a rel="nofollow" class="external text" href="https://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3160">"The generalised completeness of Horn predicate-logic as a programming language"</a>. <i>Acta Cybernetica</i>. <b>4</b> (1): <span class="nowrap">3–</span>10.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFGreen" class="citation conference cs1">Green, Cordell. <a rel="nofollow" class="external text" href="https://www.ijcai.org/Proceedings/69/Papers/023.pdf"><i>Application of Theorem Proving to Problem Solving</i></a> <span class="cs1-format">(PDF)</span>. IJCAI 1969.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFFosterElcock1969" class="citation conference cs1">Foster, J.M.; Elcock, E.W. (1969). <i>ABSYS 1: An Incremental Compiler for Assertions: an Introduction</i>. Fourth Annual Machine Intelligence Workshop. Machine Intelligence. Vol.&nbsp;4. Edinburgh, UK: <a href="Edinburgh_University_Press" title="Edinburgh University Press">Edinburgh University Press</a>. pp.&nbsp;<span class="nowrap">423–</span>429.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFKowalski1988" class="citation journal cs1">Kowalski, R. A. (1988). <a rel="nofollow" class="external text" href="http://www.doc.ic.ac.uk/~rak/papers/the%20early%20years.pdf">"The early years of logic programming"</a> <span class="cs1-format">(PDF)</span>. <i>Communications of the ACM</i>. <b>31</b>: <span class="nowrap">38–</span>43. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F35043.35046">10.1145/35043.35046</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:12259230">12259230</a>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFHewitt" class="citation conference cs1"><a href="Carl_Hewitt" title="Carl Hewitt">Hewitt, Carl</a>. <a rel="nofollow" class="external text" href="https://www.ijcai.org/Proceedings/69/Papers/030.pdf"><i>Planner: A Language for Proving Theorems in Robots</i></a> <span class="cs1-format">(PDF)</span>. IJCAI 1969.</cite></span>
</li>
<li id="cite_note-Winograd-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-Winograd_7-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFWinograd1972" class="citation journal cs1"><a href="Terry_Winograd" title="Terry Winograd">Winograd, Terry</a> (1972). "Understanding natural language". <i><a href="Cognitive_Psychology_(journal)" title="Cognitive Psychology (journal)">Cognitive Psychology</a></i>. <b>3</b> (1): <span class="nowrap">1–</span>191. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0010-0285%2872%2990002-3">10.1016/0010-0285(72)90002-3</a>.</cite></span>
</li>
<li id="cite_note-Rulifson-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-Rulifson_8-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFJeff_RulifsonJan_DerksenRichard_Waldinger1973" class="citation techreport cs1"><a href="Jeff_Rulifson" title="Jeff Rulifson">Jeff Rulifson</a>; Jan Derksen; Richard Waldinger (November 1973). <a rel="nofollow" class="external text" href="https://apps.dtic.mil/sti/pdfs/ADA052440.pdf"><i>QA4, A Procedural Calculus for Intuitive Reasoning</i></a> <span class="cs1-format">(PDF)</span> (Technical report). SRI AI Center Technical Note 73.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text">Davies, J.M., 1971. POPLER: a POP-2 planner. Edinburgh University, Department of Machine Intelligence and Perception.</span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite id="CITEREFMcDermottSussman1972" class="citation techreport cs1"><a href="Drew_McDermott" title="Drew McDermott">McDermott, D.V.</a>; <a href="Gerald_Jay_Sussman" title="Gerald Jay Sussman">Sussman, G.J.</a> (May 1972). <a rel="nofollow" class="external text" href="https://www.researchgate.net/publication/37597046_The_Conniver_Reference_Manual"><i>The Conniver reference manual</i></a> (Technical report). Artificial Intelligence Memo No. 259.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite id="CITEREFRebohSacerdoti1973" class="citation techreport cs1">Reboh, R.; Sacerdoti, E.D. (August 1973). <a rel="nofollow" class="external text" href="https://www.sri.com/publication/cyber-formal-methods-pubs/preliminary-qlisp-manual/"><i>A preliminary QLISP manual</i></a> (Technical report). Artificial Intelligence Center, SRI International.</cite></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite id="CITEREFKornfeldHewitt1981" class="citation journal cs1">Kornfeld, W.A.; <a href="Carl_Hewitt" title="Carl Hewitt">Hewitt, C.E.</a> (1981). "The scientific community metaphor". <i>IEEE Transactions on Systems, Man, and Cybernetics</i>. <b>11</b> (1): <span class="nowrap">24–</span>33. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FTSMC.1981.4308575">10.1109/TSMC.1981.4308575</a>. <a href="Hdl_(identifier)" class="mw-redirect" title="Hdl (identifier)">hdl</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://hdl.handle.net/1721.1%2F5693">1721.1/5693</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:1322857">1322857</a>.</cite></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><cite id="CITEREFHayes1973" class="citation conference cs1">Hayes, Pat (1973). "Computation and Deduction". <i>Proceedings of the 2nd MFCS Symposium</i>. <a href="Czechoslovak_Academy_of_Sciences" title="Czechoslovak Academy of Sciences">Czechoslovak Academy of Sciences</a>. pp.&nbsp;<span class="nowrap">105–</span>118.</cite></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite id="CITEREFRobinson1965" class="citation journal cs1">Robinson, J. (1965). "Automatic deduction with hyper-resolution". <i><a href="International_Journal_of_Computer_Mathematics" title="International Journal of Computer Mathematics">International Journal of Computer Mathematics</a></i>. <b>1</b> (3): <span class="nowrap">227–</span>234. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.2307%2F2272384">10.2307/2272384</a>. <a href="JSTOR_(identifier)" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.jstor.org/stable/2272384">2272384</a>.</cite></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><cite id="CITEREFKowalskiKuehner1971" class="citation journal cs1">Kowalski, Robert; Kuehner, Donald (1971). <a rel="nofollow" class="external text" href="http://www.doc.ic.ac.uk/~rak/papers/sl.pdf">"Linear Resolution with Selection Function"</a> <span class="cs1-format">(PDF)</span>. <i><a href="Artificial_Intelligence_(journal)" title="Artificial Intelligence (journal)">Artificial Intelligence</a></i>. <b>2</b> (<span class="nowrap">3–</span>4): <span class="nowrap">227–</span>260. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0004-3702%2871%2990012-9">10.1016/0004-3702(71)90012-9</a>.</cite></span>
</li>
<li id="cite_note-Kowalski-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-Kowalski_16-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFKowalski1973" class="citation web cs1">Kowalski, Robert (1973). <a rel="nofollow" class="external text" href="https://www.doc.ic.ac.uk/~rak/papers/IFIP%2074.pdf">"Predicate Logic as a Programming Language"</a> <span class="cs1-format">(PDF)</span>. Department of Artificial Intelligence, <a href="Edinburgh_University" class="mw-redirect" title="Edinburgh University">Edinburgh University</a>. Memo 70.</cite> Also in Proceedings IFIP Congress, Stockholm, North Holland Publishing Co., 1974, pp.&nbsp;569–574.</span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><cite id="CITEREFWarrenPereiraPereira1977" class="citation journal cs1">Warren, D.H.; Pereira, L.M.; Pereira, F. (1977). "Prolog-the language and its implementation compared with Lisp". <i><a href="ACM_SIGPLAN_Notices" class="mw-redirect" title="ACM SIGPLAN Notices">ACM SIGPLAN Notices</a></i>. <b>12</b> (8): <span class="nowrap">109–</span>115. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F872734.806939">10.1145/872734.806939</a>.</cite></span>
</li>
<li id="cite_note-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-18">^</a></b></span> <span class="reference-text">Ueda, K., 2018. Logic/constraint programming and concurrency: The hard-won lessons of the fifth generation computer project. Science of Computer Programming, 164, pp.3-17.</span>
</li>
<li id="cite_note-19"><span class="mw-cite-backlink"><b><a href="#cite_ref-19">^</a></b></span> <span class="reference-text">H.P. Newquist, 2020. The Brain Makers: The History Of Artificial Intelligence. The Relayer Group.</span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-20">^</a></b></span> <span class="reference-text"><cite id="CITEREFGallaireMinker1978" class="citation cs2">Gallaire, Hervé; Minker, John 'Jack', eds. (1978), "Logic and Data Bases, Symposium on Logic and Data Bases, Centre d'études et de recherches de Toulouse, 1977", <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/logicdatabases0000symp"><i>Advances in Data Base Theory</i></a></span>, New York: Plenum Press, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-306-40060-5</bdi></cite>.</span>
</li>
<li id="cite_note-Prolog_Book-21"><span class="mw-cite-backlink">^ <a href="#cite_ref-Prolog_Book_21-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Prolog_Book_21-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFWarren2023" class="citation book cs1">Warren, D.S. (2023). "Introduction to Prolog". In Warren, D.S.; Dahl, V.; Eiter, T.; Hermenegildo, M.V.; Kowalski, R.; Rossi, F. (eds.). <i>Prolog: The Next 50 Years</i>. Lecture Notes in Computer Science(). Vol.&nbsp;13900. Springer, Cham. pp.&nbsp;<span class="nowrap">3–</span>19. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F978-3-031-35254-6_1">10.1007/978-3-031-35254-6_1</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-3-031-35253-9</bdi>.</cite></span>
</li>
<li id="cite_note-22"><span class="mw-cite-backlink"><b><a href="#cite_ref-22">^</a></b></span> <span class="reference-text"><cite id="CITEREFRobinson2001" class="citation journal cs1">Robinson, J. Alan (2001). <a rel="nofollow" class="external text" href="https://doi.org/10.1017%2Fs1471068400000028">"Invited Editorial"</a>. <i>Theory and Practice of Logic Programming</i>. <b>1</b> (1). <a href="Cambridge_University_Press" title="Cambridge University Press">Cambridge University Press</a>: 1. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1017%2Fs1471068400000028">10.1017/s1471068400000028</a></span>.</cite></span>
</li>
<li id="cite_note-23"><span class="mw-cite-backlink"><b><a href="#cite_ref-23">^</a></b></span> <span class="reference-text"><cite id="CITEREFR.A.Kowalski1979" class="citation journal cs1">R.A.Kowalski (July 1979). <a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F359131.359136">"Algorithm=Logic + Control"</a>. <i><a href="Communications_of_the_ACM" title="Communications of the ACM">Communications of the ACM</a></i>. <b>22</b> (7): <span class="nowrap">424–</span>436. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F359131.359136">10.1145/359131.359136</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2509896">2509896</a>.</cite></span>
</li>
<li id="cite_note-24"><span class="mw-cite-backlink"><b><a href="#cite_ref-24">^</a></b></span> <span class="reference-text"><cite id="CITEREFBruynooghePereira1984" class="citation book cs1">Bruynooghe, M.; Pereira, L.M. (1984). "Deduction revision by intelligent backtracking". <i>Implementations of Prolog</i>. Chichester, England: Ellis Horwood. pp.&nbsp;<span class="nowrap">194–</span>215.</cite></span>
</li>
<li id="cite_note-25"><span class="mw-cite-backlink"><b><a href="#cite_ref-25">^</a></b></span> <span class="reference-text"><cite id="CITEREFNakamura1985" class="citation conference cs1">Nakamura, K. (July 1985). <i>Heuristic Prolog: logic program execution by heuristic search</i>. Conference on Logic Programming. Berlin, Heidelberg: Springer Berlin Heidelberg. pp.&nbsp;<span class="nowrap">148–</span>155.</cite></span>
</li>
<li id="cite_note-26"><span class="mw-cite-backlink"><b><a href="#cite_ref-26">^</a></b></span> <span class="reference-text"><cite id="CITEREFGeneserethGinsberg1985" class="citation journal cs1">Genesereth, M.R.; Ginsberg, M.L. (1985). <a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F4284.4287">"Logic programming"</a>. <i><a href="Communications_of_the_ACM" title="Communications of the ACM">Communications of the ACM</a></i>. <b>28</b> (9): <span class="nowrap">933–</span>941. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F4284.4287">10.1145/4284.4287</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:15527861">15527861</a>.</cite></span>
</li>
<li id="cite_note-27"><span class="mw-cite-backlink"><b><a href="#cite_ref-27">^</a></b></span> <span class="reference-text"><cite id="CITEREFSwiftWarren2012" class="citation journal cs1">Swift, T.; Warren, D.S. (January 2012). "XSB: Extending Prolog with tabled logic programming". <i><a href="Theory_and_Practice_of_Logic_Programming" class="mw-redirect" title="Theory and Practice of Logic Programming">Theory and Practice of Logic Programming</a></i>. <b>12</b> (<span class="nowrap">1–</span>2): <span class="nowrap">157–</span>187. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1012.5123">1012.5123</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1017%2FS1471068411000500">10.1017/S1471068411000500</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:6153112">6153112</a>.</cite></span>
</li>
<li id="cite_note-dis-28"><span class="mw-cite-backlink">^ <a href="#cite_ref-dis_28-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-dis_28-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFDaniel_FriedmanWilliam_ByrdOleg_KiselyovJason_Hemann2018" class="citation book cs1">Daniel Friedman; William Byrd; Oleg Kiselyov; Jason Hemann (2018). <i>The Reasoned Schemer, Second Edition</i>. The MIT Press.</cite></span>
</li>
<li id="cite_note-29"><span class="mw-cite-backlink"><b><a href="#cite_ref-29">^</a></b></span> <span class="reference-text">A. Casas, D. Cabeza, M. V. Hermenegildo. A Syntactic Approach to
Combining Functional Notation, Lazy Evaluation and Higher-Order in
LP Systems. The 8th International Symposium on Functional and Logic Programming (FLOPS'06), pages 142-162, April 2006.</span>
</li>
<li id="cite_note-30"><span class="mw-cite-backlink"><b><a href="#cite_ref-30">^</a></b></span> <span class="reference-text">Kersting, K., Mladenov, M. and Tokmakov, P., 2017. Relational linear programming. Artificial Intelligence, 244, pp.188-216.</span>
</li>
<li id="cite_note-31"><span class="mw-cite-backlink"><b><a href="#cite_ref-31">^</a></b></span> <span class="reference-text">Beyer, D., 2006, May. Relational programming with CrocoPat. In Proceedings of the 28th International Conference on Software engineering (pp. 807-810).</span>
</li>
<li id="cite_note-32"><span class="mw-cite-backlink"><b><a href="#cite_ref-32">^</a></b></span> <span class="reference-text"><cite id="CITEREFMacLennan1983" class="citation journal cs1">MacLennan, Bruce James (March 1983). <a href="Richard_Wexelblat" title="Richard Wexelblat">Wexelblat, Richard L.</a> (ed.). <span class="id-lock-subscription" title="Paid subscription required"><a rel="nofollow" class="external text" href="https://dl.acm.org/doi/10.1145/988209.988213">"Overview of relational programming"</a></span>. <i>ACM SIGPLAN Notices</i>. <b>18</b> (3). New York, NY: Association for Computing Machinery: <span class="nowrap">36–</span>45. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F988209.988213">10.1145/988209.988213</a>. <a href="Hdl_(identifier)" class="mw-redirect" title="Hdl (identifier)">hdl</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://hdl.handle.net/10945%2F29034">10945/29034</a></span>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a>&nbsp;<a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0362-1340">0362-1340</a>. <a href="OCLC_(identifier)" class="mw-redirect" title="OCLC (identifier)">OCLC</a>&nbsp;<a rel="nofollow" class="external text" href="https://search.worldcat.org/oclc/25073822">25073822</a><span class="reference-accessdate">. Retrieved <span class="nowrap">8 May</span> 2025</span>.</cite></span>
</li>
<li id="cite_note-33"><span class="mw-cite-backlink"><b><a href="#cite_ref-33">^</a></b></span> <span class="reference-text">Behnke, R., Berghammer, R., Meyer, E. and Schneider, P., 1998. RELVIEW—A system for calculating with relations and relational programming. In Fundamental Approaches to Software Engineering: First International Conference, FASE'98 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS'98 Lisbon, Portugal, March 28–April 4, 1998 Proceedings 1 (pp. 318-321). Springer Berlin Heidelberg.</span>
</li>
<li id="cite_note-34"><span class="mw-cite-backlink"><b><a href="#cite_ref-34">^</a></b></span> <span class="reference-text"><cite id="CITEREFVan_EmdenKowalski1976" class="citation journal cs1">Van Emden, M.H.; Kowalski, R.A. (October 1976). <a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F321978.321991">"The semantics of predicate logic as a programming language"</a>. <i><a href="Journal_of_the_ACM" title="Journal of the ACM">Journal of the ACM</a></i>. <b>23</b> (4): <span class="nowrap">733–</span>742. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F321978.321991">10.1145/321978.321991</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:11048276">11048276</a>.</cite></span>
</li>
<li id="cite_note-35"><span class="mw-cite-backlink"><b><a href="#cite_ref-35">^</a></b></span> <span class="reference-text"><cite id="CITEREFClark1977" class="citation book cs1"><a href="Keith_Clark_(computer_scientist)" title="Keith Clark (computer scientist)">Clark, K.L.</a> (1977). "Negation as Failure". <i>Logic and Data Bases</i>. Boston, MA: Springer US. pp.&nbsp;<span class="nowrap">293–</span>322. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F978-1-4684-3384-5_11">10.1007/978-1-4684-3384-5_11</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-4684-3386-9</bdi>.</cite></span>
</li>
<li id="cite_note-36"><span class="mw-cite-backlink"><b><a href="#cite_ref-36">^</a></b></span> <span class="reference-text"><cite id="CITEREFGelfondPrzymusinskaPrzymusinski1989" class="citation journal cs1">Gelfond, M.; Przymusinska, H.; Przymusinski, T. (1989). "On the relationship between circumscription and negation as failure". <i><a href="Artificial_Intelligence_(journal)" title="Artificial Intelligence (journal)">Artificial Intelligence</a></i>. <b>38</b> (1): <span class="nowrap">75–</span>94. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0004-3702%2889%2990068-4">10.1016/0004-3702(89)90068-4</a>.</cite></span>
</li>
<li id="cite_note-37"><span class="mw-cite-backlink"><b><a href="#cite_ref-37">^</a></b></span> <span class="reference-text"><cite id="CITEREFShepherdson1984" class="citation journal cs1">Shepherdson, J.C. (1984). "Negation as failure: a comparison of Clark's completed data base and Reiter's closed world assumption". <i><a href="The_Journal_of_Logic_Programming" class="mw-redirect" title="The Journal of Logic Programming">The Journal of Logic Programming</a></i>. <b>1</b> (1): <span class="nowrap">51–</span>79. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0743-1066%2884%2990023-2">10.1016/0743-1066(84)90023-2</a>.</cite></span>
</li>
<li id="cite_note-38"><span class="mw-cite-backlink"><b><a href="#cite_ref-38">^</a></b></span> <span class="reference-text"><cite id="CITEREFDeneckerTernovska2008" class="citation journal cs1">Denecker, M.; Ternovska, E. (2008). <a rel="nofollow" class="external text" href="https://lirias.kuleuven.be/handle/123456789/222628">"A logic of nonmonotone inductive definitions"</a>. <i><a href="ACM_Transactions_on_Computational_Logic" title="ACM Transactions on Computational Logic">ACM Transactions on Computational Logic</a></i>. <b>9</b> (2): 14:1–14:52. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/cs/0501025">cs/0501025</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1342991.1342998">10.1145/1342991.1342998</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:13156469">13156469</a>.</cite></span>
</li>
<li id="cite_note-39"><span class="mw-cite-backlink"><b><a href="#cite_ref-39">^</a></b></span> <span class="reference-text"><cite id="CITEREFRaoSagonasSwiftWarren1997" class="citation conference cs1">Rao, P.; Sagonas, K.; Swift, T.; Warren, D.S.; Freire, J. (July 28–31, 1997). <i>XSB: A system for efficiently computing well-founded semantics</i>. Logic Programming And Nonmonotonic Reasoning: 4th International Conference, LPNMR'97. Dagstuhl Castle, Germany: Springer Berlin Heidelberg. pp.&nbsp;<span class="nowrap">430–</span>440. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F3-540-63255-7_33">10.1007/3-540-63255-7_33</a>.</cite></span>
</li>
<li id="cite_note-40"><span class="mw-cite-backlink"><b><a href="#cite_ref-40">^</a></b></span> <span class="reference-text"><cite id="CITEREFW._ChenD._S._Warren1996" class="citation journal cs1">W. Chen; D. S. Warren (January 1996). <a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F227595.227597">"Tabled Evaluation with Delaying for General Logic Programs"</a>. <i><a href="Journal_of_the_ACM" title="Journal of the ACM">Journal of the ACM</a></i>. <b>43</b> (1): <span class="nowrap">20–</span>74. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F227595.227597">10.1145/227595.227597</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:7041379">7041379</a>.</cite></span>
</li>
<li id="cite_note-41"><span class="mw-cite-backlink"><b><a href="#cite_ref-41">^</a></b></span> <span class="reference-text"><cite id="CITEREFPhan_Minh_Dung1995" class="citation journal cs1">Phan Minh Dung (1995). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0004-3702%2894%2900041-X">"On the acceptability of arguments and its fundamental role in nonmonotonic reasoning, logic programming, and n–person games"</a>. <i>Artificial Intelligence</i>. <b>77</b> (2): <span class="nowrap">321–</span>357. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0004-3702%2894%2900041-X">10.1016/0004-3702(94)00041-X</a></span>.</cite></span>
</li>
<li id="cite_note-42"><span class="mw-cite-backlink"><b><a href="#cite_ref-42">^</a></b></span> <span class="reference-text">Colmerauer, A. and Roussel, P., 1996. The birth of Prolog. In History of programming languages---II (pp. 331-367).</span>
</li>
<li id="cite_note-Warren-43"><span class="mw-cite-backlink">^ <a href="#cite_ref-Warren_43-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Warren_43-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text">Warren, D.H., Pereira, L.M. and Pereira, F., 1977. Prolog-the language and its implementation compared with Lisp. ACM SIGPLAN Notices, 12(8), pp.109-115.</span>
</li>
<li id="cite_note-44"><span class="mw-cite-backlink"><b><a href="#cite_ref-44">^</a></b></span> <span class="reference-text"><cite id="CITEREFThagard2005" class="citation book cs1">Thagard, Paul (2005). <i>Mind: Introduction to Cognitive Science</i>. The MIT Press. p.&nbsp;11. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780262701099</bdi>.</cite><a rel="nofollow" class="external free" href="https://www.google.co.uk/books/edition/Mind_second_edition/gjcR1U2HT7kC?hl=en&amp;gbpv=1&amp;pg=PP11&amp;printsec=frontcover">https://www.google.co.uk/books/edition/Mind_second_edition/gjcR1U2HT7kC?hl=en&amp;gbpv=1&amp;pg=PP11&amp;printsec=frontcover</a></span>
</li>
<li id="cite_note-45"><span class="mw-cite-backlink"><b><a href="#cite_ref-45">^</a></b></span> <span class="reference-text"><cite id="CITEREFStenningvan_Lambalgen,_Michiel2008" class="citation book cs1">Stenning, Keith; van Lambalgen, Michiel (2008). <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/humanreasoni_sten_2008_000_10735669"><i>Human reasoning and cognitive science</i></a></span>. <a href="MIT_Press" title="MIT Press">MIT Press</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-262-19583-6</bdi>.</cite><a rel="nofollow" class="external free" href="https://philpapers.org/archive/STEHRA-5.pdf">https://philpapers.org/archive/STEHRA-5.pdf</a></span>
</li>
<li id="cite_note-46"><span class="mw-cite-backlink"><b><a href="#cite_ref-46">^</a></b></span> <span class="reference-text">Van Lambalgen, M. and Hamm, F., 2008. The proper treatment of events. John Wiley &amp; Sons.
<a rel="nofollow" class="external free" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=3126320bb6e37ca3727fed404828b53fc56ff063">https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=3126320bb6e37ca3727fed404828b53fc56ff063</a></span>
</li>
<li id="cite_note-47"><span class="mw-cite-backlink"><b><a href="#cite_ref-47">^</a></b></span> <span class="reference-text">Reiter, R., 1991. The frame problem in the situation calculus: A simple solution (sometimes) and a completeness result for goal regression. Artificial and Mathematical Theory of Computation, 3.</span>
</li>
<li id="cite_note-48"><span class="mw-cite-backlink"><b><a href="#cite_ref-48">^</a></b></span> <span class="reference-text">Merritt, D., 2012. Building expert systems in Prolog. Springer Science &amp; Business Media. <a rel="nofollow" class="external free" href="https://ds.amu.edu.et/xmlui/bitstream/handle/123456789/4434/%28Text%20Book%29%20Building%20Expert%20Systems%20in%20Prolog.pdf?sequence=1&amp;isAllowed=y">https://ds.amu.edu.et/xmlui/bitstream/handle/123456789/4434/%28Text%20Book%29%20Building%20Expert%20Systems%20in%20Prolog.pdf?sequence=1&amp;isAllowed=y</a></span>
</li>
<li id="cite_note-49"><span class="mw-cite-backlink"><b><a href="#cite_ref-49">^</a></b></span> <span class="reference-text"><cite id="CITEREFSergotSadriKowalskiKriwaczek1986" class="citation journal cs1">Sergot, M.J.; Sadri, F.; Kowalski, R.A.; Kriwaczek, F.; Hammond, P; Cory, H.T. (1986). <a rel="nofollow" class="external text" href="http://www.doc.ic.ac.uk/~rak/papers/British%20Nationality%20Act.pdf">"The British Nationality Act as a logic program"</a> <span class="cs1-format">(PDF)</span>. <i><a href="Communications_of_the_ACM" title="Communications of the ACM">Communications of the ACM</a></i>. <b>29</b> (5): <span class="nowrap">370–</span>386. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F5689.5920">10.1145/5689.5920</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:5665107">5665107</a>.</cite></span>
</li>
<li id="cite_note-50"><span class="mw-cite-backlink"><b><a href="#cite_ref-50">^</a></b></span> <span class="reference-text"><cite id="CITEREFPrakkenSartor2015" class="citation journal cs1">Prakken, H.; Sartor, G. (October 2015). <a rel="nofollow" class="external text" href="https://www.sciencedirect.com/science/article/pii/S0004370215000910/pdfft?md5=4dc0cf07e5c2a6926d285431b987a859&amp;pid=1-s2.0-S0004370215000910-main.pdf">"Law and logic: a review from an argumentation perspective"</a> <span class="cs1-format">(PDF)</span>. <i><a href="Artificial_Intelligence_(journal)" title="Artificial Intelligence (journal)">Artificial Intelligence</a></i>. <b>227</b>: <span class="nowrap">214–</span>245. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.artint.2015.06.005">10.1016/j.artint.2015.06.005</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:4261497">4261497</a>.</cite></span>
</li>
<li id="cite_note-51"><span class="mw-cite-backlink"><b><a href="#cite_ref-51">^</a></b></span> <span class="reference-text">Satoh, K., 2023. PROLEG: Practical legal reasoning system. In Prolog: The Next 50 Years (pp. 277-283). Cham: Springer Nature Switzerland.</span>
</li>
<li id="cite_note-:02-52"><span class="mw-cite-backlink">^ <a href="#cite_ref-:02_52-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:02_52-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFKörnerLeuschelBarbosaCosta2022" class="citation journal cs1">Körner, Philipp; Leuschel, Michael; Barbosa, João; Costa, Vítor Santos; Dahl, Verónica; Hermenegildo, Manuel V.; Morales, Jose F.; Wielemaker, Jan; Diaz, Daniel; Abreu, Salvador; Ciatto, Giovanni (November 2022). <a rel="nofollow" class="external text" href="https://doi.org/10.1017%2FS1471068422000102">"Fifty Years of Prolog and Beyond"</a>. <i>Theory and Practice of Logic Programming</i>. <b>22</b> (6): <span class="nowrap">776–</span>858. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/2201.10816">2201.10816</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1017%2FS1471068422000102">10.1017/S1471068422000102</a></span>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a>&nbsp;<a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/1471-0684">1471-0684</a>.</cite></span>
</li>
<li id="cite_note-TL-53"><span class="mw-cite-backlink">^ <a href="#cite_ref-TL_53-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-TL_53-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text">Bonner, A.J. and Kifer, M., 1993, February. Transaction Logic Programming. In ICLP (Vol. 93, pp. 257-279).</span>
</li>
<li id="cite_note-54"><span class="mw-cite-backlink"><b><a href="#cite_ref-54">^</a></b></span> <span class="reference-text">Genesereth, M., 2023. Dynamic logic programming. In Prolog: The Next 50 Years (pp. 197-209). Cham: Springer Nature Switzerland.</span>
</li>
<li id="cite_note-55"><span class="mw-cite-backlink"><b><a href="#cite_ref-55">^</a></b></span> <span class="reference-text">Kowalski, R., Sadri, F., Calejo, M. and Dávila, J., 2023. Combining logic programming and imperative programming in LPS. In Prolog: The Next 50 Years (pp. 210-223). Cham: Springer Nature Switzerland.</span>
</li>
<li id="cite_note-56"><span class="mw-cite-backlink"><b><a href="#cite_ref-56">^</a></b></span> <span class="reference-text">Aho, A.V. and Ullman, J.D., 1979, January. Universality of data retrieval languages. In Proceedings of the 6th ACM SIGACT-SIGPLAN symposium on Principles of programming languages (pp. 110-119).</span>
</li>
<li id="cite_note-57"><span class="mw-cite-backlink"><b><a href="#cite_ref-57">^</a></b></span> <span class="reference-text">Maier, D., Tekle, K.T., Kifer, M. and Warren, D.S., 2018. Datalog: concepts, history, and outlook. In Declarative Logic Programming: Theory, Systems, and Applications (pp. 3-100).</span>
</li>
<li id="cite_note-58"><span class="mw-cite-backlink"><b><a href="#cite_ref-58">^</a></b></span> <span class="reference-text">Eiter, T., Ianni, G. and Krennwallner, T., 2009. Answer Set Programming: A Primer. In Reasoning Web. Semantic Technologies for Information Systems: 5th International Summer School 2009, Brixen-Bressanone, Italy, August 30-September 4, 2009, Tutorial Lectures (pp. 40-110).</span>
</li>
<li id="cite_note-59"><span class="mw-cite-backlink"><b><a href="#cite_ref-59">^</a></b></span> <span class="reference-text"><cite id="CITEREFAriasCarroSalazarMarple2018" class="citation journal cs1">Arias, J.; Carro, M.; Salazar, E.; Marple, K.; Gupta, G. (2018). <a rel="nofollow" class="external text" href="https://doi.org/10.1017%2FS1471068418000285">"Constraint Answer Set Programming without Grounding"</a>. <i>Theory and Practice of Logic Programming</i>. <b>18</b> (<span class="nowrap">3–</span>4): <span class="nowrap">337–</span>354. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1804.11162">1804.11162</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1017%2FS1471068418000285">10.1017/S1471068418000285</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:13754645">13754645</a>.</cite></span>
</li>
<li id="cite_note-60"><span class="mw-cite-backlink"><b><a href="#cite_ref-60">^</a></b></span> <span class="reference-text"><cite id="CITEREFDeneckerKakas2000" class="citation journal cs1">Denecker, M.; Kakas, A.C. (July 2000). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2FS0743-1066%2899%2900078-3">"Special issue: abductive logic programming"</a>. <i>Journal of Logic Programming</i>. <b>44</b> (<span class="nowrap">1–</span>3): <span class="nowrap">1–</span>4. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2FS0743-1066%2899%2900078-3">10.1016/S0743-1066(99)00078-3</a></span>.</cite></span>
</li>
<li id="cite_note-61"><span class="mw-cite-backlink"><b><a href="#cite_ref-61">^</a></b></span> <span class="reference-text">Eshghi, K., 1988, August. Abductive Planning with Event Calculus. In ICLP/SLP (pp. 562-579).</span>
</li>
<li id="cite_note-62"><span class="mw-cite-backlink"><b><a href="#cite_ref-62">^</a></b></span> <span class="reference-text">Eshghi, K. and Kowalski, R.A., 1989, June. Abduction Compared with Negation by Failure. In ICLP (Vol. 89, pp. 234-255).</span>
</li>
<li id="cite_note-63"><span class="mw-cite-backlink"><b><a href="#cite_ref-63">^</a></b></span> <span class="reference-text"><cite id="CITEREFNienhuys-ChengWolf1997" class="citation book cs1">Nienhuys-Cheng, Shan-hwei; Wolf, Ronald de (1997). <i>Foundations of inductive logic programming</i>. Lecture notes in computer science Lecture notes in artificial intelligence. Berlin Heidelberg: Springer. p.&nbsp;173. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-3-540-62927-6</bdi>.</cite></span>
</li>
<li id="cite_note-64"><span class="mw-cite-backlink"><b><a href="#cite_ref-64">^</a></b></span> <span class="reference-text">Flach, P.A. and Kakas, A.C., 2000. On the relation between abduction and inductive learning. In Abductive Reasoning and Learning (pp. 1-33). Dordrecht: Springer Netherlands.</span>
</li>
<li id="cite_note-65"><span class="mw-cite-backlink"><b><a href="#cite_ref-65">^</a></b></span> <span class="reference-text">Cropper, A. and Dumančić, S., 2022. Inductive logic programming at 30: a new introduction. Journal of Artificial Intelligence Research, 74, pp.765-850.</span>
</li>
<li id="cite_note-66"><span class="mw-cite-backlink"><b><a href="#cite_ref-66">^</a></b></span> <span class="reference-text">Russell, S., 2019. Human compatible: Artificial intelligence and the problem of control. Penguin.</span>
</li>
<li id="cite_note-67"><span class="mw-cite-backlink"><b><a href="#cite_ref-67">^</a></b></span> <span class="reference-text">Shunichi Uchida and Kazuhiro Fuchi. <i>Proceedings of the FGCS Project Evaluation Workshop</i>. Institute for New Generation Computer Technology (ICOT). 1992.</span>
</li>
<li id="cite_note-Hewitt-68"><span class="mw-cite-backlink"><b><a href="#cite_ref-Hewitt_68-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFHewitt,_Carl2016" class="citation web cs1">Hewitt, Carl (27 April 2016). <a rel="nofollow" class="external text" href="https://hal.archives-ouvertes.fr/hal-01148496v6/document">"Inconsistency Robustness for Logic Programs"</a>. Hal Archives. pp.&nbsp;<span class="nowrap">21–</span>26<span class="reference-accessdate">. Retrieved <span class="nowrap">7 November</span> 2016</span>.</cite></span>
</li>
<li id="cite_note-69"><span class="mw-cite-backlink"><b><a href="#cite_ref-69">^</a></b></span> <span class="reference-text">Saraswat, V.A. and Rinard, M., 1989, December. Concurrent constraint programming. In Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages (pp. 232-245).</span>
</li>
<li id="cite_note-hilog-jlp-70"><span class="mw-cite-backlink"><b><a href="#cite_ref-hilog-jlp_70-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFChenKiferWarren1993" class="citation journal cs1">Chen, Weidong; Kifer, Michael; Warren, David S. (February 1993). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0743-1066%2893%2990039-J">"HiLog: A foundation for higher-order logic programming"</a>. <i><a href="Journal_of_Logic_Programming" class="mw-redirect" title="Journal of Logic Programming">Journal of Logic Programming</a></i>. <b>15</b> (3): <span class="nowrap">187–</span>230. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0743-1066%2893%2990039-J">10.1016/0743-1066(93)90039-J</a></span>.</cite></span>
</li>
<li id="cite_note-71"><span class="mw-cite-backlink"><b><a href="#cite_ref-71">^</a></b></span> <span class="reference-text">Miller, D.A. and Nadathur, G., 1986, July. Higher-order logic programming. In International Conference on Logic Programming (pp. 448-462). Berlin, Heidelberg: Springer Berlin Heidelberg.</span>
</li>
<li id="cite_note-72"><span class="mw-cite-backlink"><b><a href="#cite_ref-72">^</a></b></span> <span class="reference-text"><cite id="CITEREFAndreoli1992" class="citation journal cs1">Andreoli, Jean-Marc (1 June 1992). "Logic Programming with Focusing Proofs in Linear Logic". <i><a href="Journal_of_Logic_and_Computation" title="Journal of Logic and Computation">Journal of Logic and Computation</a></i>. <b>2</b> (3): <span class="nowrap">297–</span>347. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1093%2Flogcom%2F2.3.297">10.1093/logcom/2.3.297</a>.</cite></span>
</li>
<li id="cite_note-73"><span class="mw-cite-backlink"><b><a href="#cite_ref-73">^</a></b></span> <span class="reference-text"><cite id="CITEREFHodasMiller1994" class="citation journal cs1">Hodas, Joshua; Miller, Dale (1994). <a rel="nofollow" class="external text" href="http://repository.upenn.edu/cgi/viewcontent.cgi?article=1540&amp;context=cis_reports">"Logic Programming in a Fragment of Intuitionistic Linear Logic"</a>. <i><a href="Information_and_Computation" title="Information and Computation">Information and Computation</a></i>. <b>110</b> (2): <span class="nowrap">327–</span>365. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1006%2Finco.1994.1036">10.1006/inco.1994.1036</a></span>.</cite></span>
</li>
<li id="cite_note-74"><span class="mw-cite-backlink"><b><a href="#cite_ref-74">^</a></b></span> <span class="reference-text"><cite id="CITEREFKobayashiYonezawa1994" class="citation conference cs1">Kobayashi, Naoki; <a href="Akinori_Yonezawa" title="Akinori Yonezawa">Yonezawa, Akinori</a> (1994). <i>Asynchronous communication model based on linear logic</i>. US/Japan Workshop on Parallel Symbolic Computing. pp.&nbsp;<span class="nowrap">279–</span>294. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.8749">10.1.1.42.8749</a></span>.</cite></span>
</li>
<li id="cite_note-75"><span class="mw-cite-backlink"><b><a href="#cite_ref-75">^</a></b></span> <span class="reference-text"><cite id="CITEREFMiller1996" class="citation journal cs1">Miller, Dale (30 September 1996). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0304-3975%2896%2900045-X">"Forum: A Multiple-Conclusion Specification Logic"</a>. <i><a href="Theoretical_Computer_Science_(journal)" title="Theoretical Computer Science (journal)">Theoretical Computer Science</a></i>. <b>165</b> (1): <span class="nowrap">201–</span>232. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0304-3975%2896%2900045-X">10.1016/0304-3975(96)00045-X</a></span>.</cite></span>
</li>
<li id="cite_note-76"><span class="mw-cite-backlink"><b><a href="#cite_ref-76">^</a></b></span> <span class="reference-text">Kifer, M. and Lausen, G., 1989, June. F-logic: a higher-order language for reasoning about objects, inheritance, and scheme. In Proceedings of the 1989 ACM SIGMOD international conference on Management of data (pp. 134-146).</span>
</li>
<li id="cite_note-77"><span class="mw-cite-backlink"><b><a href="#cite_ref-77">^</a></b></span> <span class="reference-text">de Moura, P.J.L., 2003. Design of an Object-Oriented Logic Programming Language (Doctoral dissertation, Universidade da Beira Interior).</span>
</li>
<li id="cite_note-78"><span class="mw-cite-backlink"><b><a href="#cite_ref-78">^</a></b></span> <span class="reference-text">Yang, G. and Kifer, M., 2000, July. FLORA: Implementing an efficient DOOD system using a tabling logic engine. In International Conference on Computational Logic (pp. 1078-1093). Berlin, Heidelberg: Springer Berlin Heidelberg.</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="Sources">Sources</h2></div>
<div class="mw-heading mw-heading3"><h3 id="General_introductions">General introductions</h3></div>
<ul><li><cite id="CITEREFBaralGelfond1994" class="citation journal cs1 cs1-prop-long-vol">Baral, C.; Gelfond, M. (1994). <a rel="nofollow" class="external text" href="http://redwood.cs.ttu.edu/~mgelfond/PAPERS/survey.pdf">"Logic programming and knowledge representation"</a> <span class="cs1-format">(PDF)</span>. <i>The Journal of Logic Programming</i>. <span class="nowrap">19–</span>20: <span class="nowrap">73–</span>148. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0743-1066%2894%2990025-6">10.1016/0743-1066(94)90025-6</a></span>.</cite></li>
<li><cite id="CITEREFKowalski1988" class="citation journal cs1">Kowalski, R. A. (1988). <a rel="nofollow" class="external text" href="http://www.doc.ic.ac.uk/~rak/papers/the%20early%20years.pdf">"The early years of logic programming"</a> <span class="cs1-format">(PDF)</span>. <i>Communications of the ACM</i>. <b>31</b>: <span class="nowrap">38–</span>43. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F35043.35046">10.1145/35043.35046</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:12259230">12259230</a>.</cite> <a rel="nofollow" class="external autonumber" href="http://www.doc.ic.ac.uk/~rak/papers/the%20early%20years.pdf">[1]</a></li>
<li><cite id="CITEREFLloyd1987" class="citation book cs1">Lloyd, J. W. (1987). <i>Foundations of Logic Programming</i> (2nd&nbsp;ed.). Springer-Verlag.</cite></li></ul>
<div class="mw-heading mw-heading3"><h3 id="Other_sources">Other sources</h3></div>
<ul><li>John McCarthy. <a rel="nofollow" class="external text" href="http://www.cs.rit.edu/~rlaz/is2014/files/McCarthyProgramsWithCommonSense.pdf">"Programs with common sense"</a>. <i>Symposium on Mechanization of Thought Processes</i>. National Physical Laboratory. Teddington, England. 1958.</li>
<li><cite id="CITEREFMillerNadathurPfenningScedrov1991" class="citation journal cs1">Miller, Dale; Nadathur, Gopalan; Pfenning, Frank; Scedrov, Andre (1991). <a rel="nofollow" class="external text" href="https://repository.upenn.edu/cis_reports/711">"Uniform proofs as a foundation for logic programming"</a>. <i>Annals of Pure and Applied Logic</i>. <b>51</b> (<span class="nowrap">1–</span>2): <span class="nowrap">125–</span>157. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0168-0072%2891%2990068-W">10.1016/0168-0072(91)90068-W</a></span>.</cite></li>
<li>Ehud Shapiro (Editor). <i>Concurrent Prolog</i>. MIT Press. 1987.</li>
<li>James Slagle. <a rel="nofollow" class="external text" href="https://dl.acm.org/doi/abs/10.1145/365691.365960">"Experiments with a Deductive Question-Answering Program"</a>. CACM. December 1965.</li>
<li><a href="Dov_Gabbay" title="Dov Gabbay">Gabbay, Dov M.</a>; Hogger, Christopher John; Robinson, J.A., eds. (1993-1998). <a rel="nofollow" class="external text" href="https://www.worldcat.org/oclc/26300491">Handbook of Logic in Artificial Intelligence and Logic Programming</a>.Vols. 1–5, Oxford University Press.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li>Carl Hewitt. "<a rel="nofollow" class="external text" href="https://www.ijcai.org/Proceedings/71/Papers/014%20A.pdf">Procedural Embedding of Knowledge in Planner</a>". IJCAI 1971.</li>
<li>Carl Hewitt. "<a rel="nofollow" class="external text" href="https://web.archive.org/web/20170102172145/https://pdfs.semanticscholar.org/9993/ec68770faaab132da6945492b0e4ad07eb7b.pdf">The Repeated Demise of Logic Programming and Why It Will Be Reincarnated</a>". <i>AAAI Spring Symposium: What Went Wrong and Why: Lessons from AI Research and Applications</i> 2006: 2–9.</li>
<li>Evgeny Dantsin, Thomas Eiter, Georg Gottlob, Andrei Voronkov: <a rel="nofollow" class="external text" href="http://cmpe.emu.edu.tr/bayram/courses/531/forpresentation/p374-dantsin.pdf">Complexity and expressive power of logic programming</a>. ACM Comput. Surv. 33(3): 374–425 (2001)</li>
<li>Ulf Nilsson and Jan Maluszynski, <a rel="nofollow" class="external text" href="http://www.ida.liu.se/~ulfni/lpp/">Logic, Programming and Prolog</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1290876196">
/* start https://en.wikipedia.org/ */


.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:var(--background-color-interactive-subtle,#f8f9fa);display:flow-root}.mw-parser-output .infobox .side-box{font-size:100%}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1237033735">
/* start https://en.wikipedia.org/ */


@media print{body.ns-0 .mw-parser-output .sistersitebox{display:none!important}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}


/* end https://en.wikipedia.org/ */
</style><div class="side-box side-box-right sistersitebox"><style data-mw-deduplicate="TemplateStyles:r1126788409">
/* start https://en.wikipedia.org/ */


.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}


/* end https://en.wikipedia.org/ */
</style>
<div class="side-box-flex">
<div class="side-box-image"><span class="noviewer" typeof="mw:File"></span></div>
<div class="side-box-text plainlist">Wikimedia Commons has media related to <span style="font-weight: bold; font-style: italic;"><a href="https://commons.wikimedia.org/wiki/Category:Logic_programming" class="extiw external" title="commons:Category:Logic programming">Logic programming</a></span>.</div></div>
</div>
<ul><li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20050828194751/http://vl.fmnet.info/logic-prog/"><i>Logic Programming</i> Virtual Library entry</a></li>
<li><a rel="nofollow" class="external text" href="http://liinwww.ira.uka.de/bibliography/LogicProgramming/">Bibliographies on Logic Programming</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20081204113711/http://liinwww.ira.uka.de/bibliography/LogicProgramming/">Archived</a> 2008-12-04 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></li>
<li><a rel="nofollow" class="external text" href="http://www.logicprogramming.org/">Association for Logic Programming (ALP)</a></li>
<li><i><a rel="nofollow" class="external text" href="http://www.cs.kuleuven.be/~dtai/projects/ALP/TPLP/">Theory and Practice of Logic Programming</a></i> (journal)</li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20090108012954/http://www.mpprogramming.com/Cpp/">Logic programming in C++ with Castor</a></li>
<li><a rel="nofollow" class="external text" href="http://www.mozart-oz.org/documentation/tutorial/node12.html">Logic programming</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20110903022204/http://www.mozart-oz.org/documentation/tutorial/node12.html">Archived</a> 2011-09-03 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a> in <a href="Oz_programming_language" class="mw-redirect" title="Oz programming language">Oz</a></li>
<li><a rel="nofollow" class="external text" href="http://www.pdc.dk/">Prolog Development Center </a></li>
<li><a rel="nofollow" class="external text" href="http://docs.racket-lang.org/racklog/">Racklog: Logic Programming in Racket</a></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Programming_paradigms_(Comparison_by_language)368" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div id="Programming_paradigms_(Comparison_by_language)368" style="font-size:114%;margin:0 4em"><a href="Programming_paradigm" title="Programming paradigm">Programming paradigms</a> (<a href="Comparison_of_multi-paradigm_programming_languages" title="Comparison of multi-paradigm programming languages">Comparison by language</a>)</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Imperative_programming" title="Imperative programming">Imperative</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Structured_programming" title="Structured programming">Structured</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Jackson_structured_programming" title="Jackson structured programming">Jackson structures</a></li>
<li><a href="Block_(programming)" title="Block (programming)">Block-structured</a></li>
<li><a href="Modular_programming" title="Modular programming">Modular</a></li>
<li><a href="Non-structured_programming" title="Non-structured programming">Non-structured</a></li>
<li><a href="Procedural_programming" title="Procedural programming">Procedural</a></li>
<li><a href="Programming_in_the_large_and_programming_in_the_small" title="Programming in the large and programming in the small">Programming in the large and in the small</a></li>
<li><a href="Design_by_contract" title="Design by contract">Design by contract</a></li>
<li><a href="Invariant-based_programming" title="Invariant-based programming">Invariant-based</a></li>
<li><a href="Nested_function" title="Nested function">Nested function</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Object-oriented_programming" title="Object-oriented programming">Object-oriented</a><br>(<a href="Comparison_of_programming_languages_(object-oriented_programming)" title="Comparison of programming languages (object-oriented programming)">comparison</a>, <a href="List_of_object-oriented_programming_languages" title="List of object-oriented programming languages">list</a>)</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Class-based_programming" title="Class-based programming">Class-based</a>, <a href="Prototype-based_programming" title="Prototype-based programming">Prototype-based</a>, <a href="Object-based_language" title="Object-based language">Object-based</a></li>
<li><a href="Agent-oriented_programming" title="Agent-oriented programming">Agent</a></li>
<li><a href="Immutable_object" title="Immutable object">Immutable object</a></li>
<li><a href="Persistent_programming_language" title="Persistent programming language">Persistent</a></li>
<li><a href="Uniform_function_call_syntax" title="Uniform function call syntax">Uniform function call syntax</a></li></ul>
</div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Declarative_programming" title="Declarative programming">Declarative</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Functional_programming" title="Functional programming">Functional</a><br>(<a href="Comparison_of_functional_programming_languages" title="Comparison of functional programming languages">comparison</a>)</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Recursion_(computer_science)" title="Recursion (computer science)">Recursive</a></li>
<li><a href="Anonymous_function" title="Anonymous function">Anonymous function</a> (<a href="Partial_application" title="Partial application">Partial application</a>)</li>
<li><a href="Higher-order_programming" title="Higher-order programming">Higher-order</a></li>
<li><a href="Purely_functional_programming" title="Purely functional programming">Purely functional</a></li>
<li><a href="Total_functional_programming" title="Total functional programming">Total</a></li>
<li><a href="Strict_programming_language" title="Strict programming language">Strict</a></li>
<li><a href="Generalized_algebraic_data_type" title="Generalized algebraic data type">GADTs</a></li>
<li><a href="Dependent_type" title="Dependent type">Dependent types</a></li>
<li><a href="Functional_logic_programming" title="Functional logic programming">Functional logic</a></li>
<li><a href="Tacit_programming" title="Tacit programming">Point-free style</a></li>
<li><a href="Expression-oriented_programming_language" title="Expression-oriented programming language">Expression-oriented</a></li>
<li><a href="Applicative_programming_language" title="Applicative programming language">Applicative</a>, <a href="Concatenative_programming_language" title="Concatenative programming language">Concatenative</a></li>
<li><a href="Function-level_programming" title="Function-level programming">Function-level</a>, <a href="Value-level_programming" title="Value-level programming">Value-level</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Dataflow_programming" title="Dataflow programming">Dataflow</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Flow-based_programming" title="Flow-based programming">Flow-based</a></li>
<li><a href="Reactive_programming" title="Reactive programming">Reactive</a> (<a href="Functional_reactive_programming" title="Functional reactive programming">Functional reactive</a>)</li>
<li><a href="Signal_programming" class="mw-redirect" title="Signal programming">Signals</a></li>
<li><a href="Stream_processing" title="Stream processing">Streams</a></li>
<li><a href="Synchronous_programming_language" title="Synchronous programming language">Synchronous</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Abductive_logic_programming" title="Abductive logic programming">Abductive logic</a></li>
<li><a href="Answer_set_programming" title="Answer set programming">Answer set</a></li>
<li><a href="Constraint_programming" title="Constraint programming">Constraint</a> (<a href="Constraint_logic_programming" title="Constraint logic programming">Constraint logic</a>)</li>
<li><a href="Inductive_logic_programming" title="Inductive logic programming">Inductive logic</a></li>
<li><a href="Nondeterministic_programming" title="Nondeterministic programming">Nondeterministic</a></li>
<li><a href="Ontology_language" title="Ontology language">Ontology</a></li>
<li><a href="Probabilistic_logic_programming" title="Probabilistic logic programming">Probabilistic logic</a></li>
<li><a href="Query_language" title="Query language">Query</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Domain-specific_language" title="Domain-specific language">DSL</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Algebraic_modeling_language" title="Algebraic modeling language">Algebraic modeling</a></li>
<li><a href="Array_programming" title="Array programming">Array</a></li>
<li><a href="Automata-based_programming" title="Automata-based programming">Automata-based</a> (<a href="Action_language" title="Action language">Action</a>)</li>
<li><a href="Command_language" title="Command language">Command</a> (<a href="Spacecraft_command_language" title="Spacecraft command language">Spacecraft</a>)</li>
<li><a href="Differentiable_programming" title="Differentiable programming">Differentiable</a></li>
<li><a href="End-user_development" title="End-user development">End-user</a></li>
<li><a href="Grammar-oriented_programming" title="Grammar-oriented programming">Grammar-oriented</a></li>
<li><a href="Interface_description_language" title="Interface description language">Interface description</a></li>
<li><a href="Language-oriented_programming" title="Language-oriented programming">Language-oriented</a></li>
<li><a href="List_comprehension" title="List comprehension">List comprehension</a></li>
<li><a href="Low-code_development_platform" title="Low-code development platform">Low-code</a></li>
<li><a href="Modeling_language" title="Modeling language">Modeling</a></li>
<li><a href="Natural-language_programming" class="mw-redirect" title="Natural-language programming">Natural language</a></li>
<li><a href="Non-English-based_programming_languages" title="Non-English-based programming languages">Non-English-based</a></li>
<li><a href="Page_description_language" title="Page description language">Page description</a></li>
<li><a href="Pipeline_(software)" title="Pipeline (software)">Pipes</a> and <a href="Filter_(software)" title="Filter (software)">filters</a></li>
<li><a href="Probabilistic_programming" title="Probabilistic programming">Probabilistic</a></li>
<li><a href="Quantum_programming" title="Quantum programming">Quantum</a></li>
<li><a href="Scientific_programming_language" title="Scientific programming language">Scientific</a></li>
<li><a href="Scripting_language" title="Scripting language">Scripting</a></li>
<li><a href="Set_theoretic_programming" title="Set theoretic programming">Set-theoretic</a></li>
<li><a href="Simulation_language" title="Simulation language">Simulation</a></li>
<li><a href="Stack-oriented_programming" title="Stack-oriented programming">Stack-based</a></li>
<li><a href="System_programming_language" title="System programming language">System</a></li>
<li><a href="Tactile_programming_language" title="Tactile programming language">Tactile</a></li>
<li><a href="Template_processor" title="Template processor">Templating</a></li>
<li><a href="Transformation_language" title="Transformation language">Transformation</a> (<a href="Graph_rewriting" title="Graph rewriting">Graph rewriting</a>, <a href="Production_system_(computer_science)" title="Production system (computer science)">Production</a>, <a href="Pattern_matching" title="Pattern matching">Pattern</a>)</li>
<li><a href="Visual_programming_language" title="Visual programming language">Visual</a></li></ul>
</div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Concurrent_computing" title="Concurrent computing">Concurrent</a>,<br><a href="Distributed_computing" title="Distributed computing">distributed</a>,<br><a href="Parallel_computing" title="Parallel computing">parallel</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Actor_model" title="Actor model">Actor-based</a></li>
<li><a href="Automatic_mutual_exclusion" title="Automatic mutual exclusion">Automatic mutual exclusion</a></li>
<li><a href="Choreographic_programming" title="Choreographic programming">Choreographic programming</a></li>
<li><a href="Concurrent_logic_programming" title="Concurrent logic programming">Concurrent logic</a> (<a href="Concurrent_constraint_logic_programming" title="Concurrent constraint logic programming">Concurrent constraint logic</a>)</li>
<li><a href="Concurrent_object-oriented_programming" title="Concurrent object-oriented programming">Concurrent OO</a></li>
<li><a href="Macroprogramming" title="Macroprogramming">Macroprogramming</a></li>
<li><a href="Multitier_programming" title="Multitier programming">Multitier programming</a></li>
<li><a href="Organic_computing" title="Organic computing">Organic computing</a></li>
<li><a href="Parallel_programming_model" title="Parallel programming model">Parallel programming models</a></li>
<li><a href="Partitioned_global_address_space" title="Partitioned global address space">Partitioned global address space</a></li>
<li><a href="Process-oriented_programming" title="Process-oriented programming">Process-oriented</a></li>
<li><a href="Relativistic_programming" title="Relativistic programming">Relativistic programming</a></li>
<li><a href="Service-oriented_programming" title="Service-oriented programming">Service-oriented</a></li>
<li><a href="Structured_concurrency" title="Structured concurrency">Structured concurrency</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Metaprogramming" title="Metaprogramming">Metaprogramming</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Attribute-oriented_programming" title="Attribute-oriented programming">Attribute-oriented</a></li>
<li><a href="Automatic_programming" title="Automatic programming">Automatic</a> (<a href="Inductive_programming" title="Inductive programming">Inductive</a>)</li>
<li><a href="Dynamic_programming_language" title="Dynamic programming language">Dynamic</a></li>
<li><a href="Extensible_programming" title="Extensible programming">Extensible</a></li>
<li><a href="Generic_programming" title="Generic programming">Generic</a></li>
<li><a href="Homoiconicity" title="Homoiconicity">Homoiconicity</a></li>
<li><a href="Interactive_programming" title="Interactive programming">Interactive</a></li>
<li><a href="Macro_(computer_science)" title="Macro (computer science)">Macro</a> (<a href="Hygienic_macro" title="Hygienic macro">Hygienic</a>)</li>
<li><a href="Metalinguistic_abstraction" title="Metalinguistic abstraction">Metalinguistic abstraction</a></li>
<li><a href="Multi-stage_programming" title="Multi-stage programming">Multi-stage</a></li>
<li><a href="Program_synthesis" title="Program synthesis">Program synthesis</a> (<a href="Bayesian_program_synthesis" title="Bayesian program synthesis">Bayesian</a>, <a href="Inferential_programming" title="Inferential programming">Inferential</a>, <a href="Programming_by_demonstration" title="Programming by demonstration">by demonstration</a>, <a href="Programming_by_example" title="Programming by example">by example</a>)</li>
<li><a href="Reflective_programming" title="Reflective programming">Reflective</a></li>
<li><a href="Self-modifying_code" title="Self-modifying code">Self-modifying code</a></li>
<li><a href="Symbolic_programming" title="Symbolic programming">Symbolic</a></li>
<li><a href="Template_metaprogramming" title="Template metaprogramming">Template</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Separation_of_concerns" title="Separation of concerns">Separation<br>of concerns</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Aspect-oriented_programming" title="Aspect-oriented programming">Aspects</a></li>
<li><a href="Component-based_software_engineering" title="Component-based software engineering">Components</a></li>
<li><a href="Data-driven_programming" title="Data-driven programming">Data-driven</a></li>
<li><a href="Data-oriented_design" title="Data-oriented design">Data-oriented</a></li>
<li><a href="Event-driven_programming" title="Event-driven programming">Event-driven</a></li>
<li><a href="Feature-oriented_programming" title="Feature-oriented programming">Features</a></li>
<li><a href="Literate_programming" title="Literate programming">Literate</a></li>
<li><a href="Role-oriented_programming" title="Role-oriented programming">Roles</a></li>
<li><a href="Subject-oriented_programming" title="Subject-oriented programming">Subjects</a></li></ul>
</div></td></tr></tbody></table></div>
<div class="navbox-styles"></div><div role="navigation" class="navbox" aria-labelledby="Types_of_programming_languages107" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><div id="Types_of_programming_languages107" style="font-size:114%;margin:0 4em"><a href="Programming_paradigm" title="Programming paradigm">Types of programming languages</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Level</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Machine_code" title="Machine code">Machine</a></li>
<li><a href="Assembly_language" title="Assembly language">Assembly</a></li>
<li><a href="Compiled_language" title="Compiled language">Compiled</a></li>
<li><a href="Interpreted_language" class="mw-redirect" title="Interpreted language">Interpreted</a></li></ul>
<ul><li><a href="Low-level_programming_language" title="Low-level programming language">Low-level</a></li>
<li><a href="High-level_programming_language" title="High-level programming language">High-level</a></li>
<li><a href="Very_high-level_programming_language" title="Very high-level programming language">Very high-level</a></li>
<li><a href="Esoteric_programming_language" title="Esoteric programming language">Esoteric</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Programming_language_generations" title="Programming language generations">Generation</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="First-generation_programming_language" title="First-generation programming language">First</a></li>
<li><a href="Second-generation_programming_language" title="Second-generation programming language">Second</a></li>
<li><a href="Third-generation_programming_language" title="Third-generation programming language">Third</a></li>
<li><a href="Fourth-generation_programming_language" title="Fourth-generation programming language">Fourth</a></li>
<li><a href="Fifth-generation_programming_language" title="Fifth-generation programming language">Fifth</a></li></ul>
</div></td></tr></tbody></table></div>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1038841319">
/* start https://en.wikipedia.org/ */


.mw-parser-output .tooltip-dotted{border-bottom:1px dotted;cursor:help}


/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox authority-control" aria-labelledby="Authority_control_databases_frameless&amp;#124;text-top&amp;#124;10px&amp;#124;alt=Edit_this_at_Wikidata&amp;#124;link=https&amp;#58;//www.wikidata.org/wiki/Q275603#identifiers&amp;#124;class=noprint&amp;#124;Edit_this_at_Wikidata1260" style="padding:3px"><table class="nowraplinks hlist mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><div id="Authority_control_databases_frameless&amp;#124;text-top&amp;#124;10px&amp;#124;alt=Edit_this_at_Wikidata&amp;#124;link=https&amp;#58;//www.wikidata.org/wiki/Q275603#identifiers&amp;#124;class=noprint&amp;#124;Edit_this_at_Wikidata1260" style="font-size:114%;margin:0 4em">Authority control databases </div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">National</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"><ul><li><span class="uid"><a rel="nofollow" class="external text" href="https://d-nb.info/gnd/4195096-3">Germany</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://id.loc.gov/authorities/sh86003454">United States</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://catalogue.bnf.fr/ark:/12148/cb12067891q">France</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://data.bnf.fr/ark:/12148/cb12067891q">BnF data</a></span></li><li><span class="uid"><span class="rt-commentedText tooltip tooltip-dotted" title="logické programování"><a rel="nofollow" class="external text" href="https://aleph.nkp.cz/F/?func=find-c&amp;local_base=aut&amp;ccl_term=ica=ph122430&amp;CON_LNG=ENG">Czech Republic</a></span></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://datos.bne.es/resource/XX550687">Spain</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://www.nli.org.il/en/authorities/987007553495005171">Israel</a></span></li></ul></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Other</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"><ul><li><span class="uid"><a rel="nofollow" class="external text" href="https://lux.collections.yale.edu/view/concept/14a984a2-3609-4533-a755-951f0c1c8b84">Yale LUX</a></span></li></ul></div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-12" href="https://en.wikipedia.org/wiki/?title=Logic_programming&amp;oldid=1300095526">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>